Respondida
repeat a random function on matlab every 2 minutes
T = timer('Period',120,... %period 'ExecutionMode','fixedRate',... %{singleShot,fixedRate,fixedSpacing,fixedDelay} ...

más de 11 años hace | 1

| aceptada

Respondida
Code optimization (3 line function)
If you have MATLAB Coder, this could be a potentially good candidate for C code generation and MEXing. It involves a loop with ...

más de 11 años hace | 1

| aceptada

Respondida
How can I write all month's last dates for a given period of time?
You could use |lbusdate| to get the last business day of the month specifying no weekend days: weekend = zeros(1,7); % that...

más de 11 años hace | 0

Respondida
How can I change the color of an alphaShape object when using plot?
You can grab the handle to the patch objects making up the alpha shape as the output from plot and then change whatever properti...

más de 11 años hace | 0

| aceptada

Respondida
Matlab finding builtin file before class method file of same name
The @signal/filter will only run on an object of type "signal" I.e. sig = signal; % Make a signal, however it's done fi...

más de 11 años hace | 0

Respondida
Break a code in intermediate function
>>dbstop in my_function at 15 Or click the - next to the line number in the editor. Doc: >>web(fullfile(docroot, 'mat...

más de 11 años hace | 0

Respondida
Determine Equality and Find Command
One = sign sets, two compares. Break it down into pieces: [1 2 3 3 pi] == 3 The result is a logical vector. Find then ...

más de 11 años hace | 0

Respondida
Is it possible to get MATLAB to automatically associate legend icon colors with the applicable data?
Legend has the ability to pass in specific line objects to be legend-ized. Here, you throw away those lines in the for-loop. I...

más de 11 años hace | 0

| aceptada

Respondida
Include MATLAB output in LaTeX document?
You can publish to Latex and then copy it: <http://www.mathworks.com/help/releases/R2014b/matlab/matlab_prog/specifying-outpu...

más de 11 años hace | 0

Respondida
how to draw a symbolic function beside some dots
Works fine for me. Make sure your limits include the points: ezplot(@(x)1./x) hold on plot(rand(1,10),rand(1,10),'r*')

más de 11 años hace | 0

| aceptada

Respondida
Pass variables to the workspace from a function
function z = addtwo(x,y) z = x+y; Then call it: zz = addtwo(1,3) If you want to stop inside of addtwo, put a br...

más de 11 años hace | 0

| aceptada

Respondida
Is it poosible to keep columns in a GUI uitable visible at all times while scrolling to see theother columns?
You would have to use two uitables, one for the first two columns and a second for the rest.

más de 11 años hace | 0

Respondida
when run the program in multi-objective optimization Show error "vec" undefined
|vec| is not a function that MATLAB ships. Did you get the code from someone? It's possible they have a |vec| utility lying ar...

más de 11 años hace | 0

Respondida
problem in image resizing when shown in axes?
How big was the original? Of course it's going to lose resolution if you remove pixels (i.e. 50x50 is smaller than what you sta...

más de 11 años hace | 0

Respondida
My functin wont run my if statement. How do I fix this?
How can x by greater than or equal to 100 and less than 10? It can't. Perhaps you meant or |||| instead of and &&, or maybe...

más de 11 años hace | 0

Respondida
problem of function handles, thx
You need an @ before myfunc, otherwise it tries to evaluate it: @myfunc % reference to function myfunc; do not evaluate ...

más de 11 años hace | 0

| aceptada

Respondida
Checking for Pythagoric Triplets
This should work: isPythTrip = @(x)any(any(bsxfun(@eq,(bsxfun(@(x,y)hypot(x,y),x.',x)),circshift(x,[0 1])))) isPythTrip...

más de 11 años hace | 0

Respondida
Combine files into a CSV
doc dir doc fopen doc fgetl doc fprintf doc fclose Use dir to find the three files to read. Fopen the files for read...

más de 11 años hace | 0

Respondida
histogram and plot at the same
histogram(randn(1000,1)) hold on plot(-6:6,abs(sin(-6:6)*100)) In R2014b. In R2014a and earlier use |hist()| instead of ...

más de 11 años hace | 2

| aceptada

Respondida
Matlab went to sleep?
Usually this has to do with the path/current folder/license file being on a network drive.

más de 11 años hace | 1

Respondida
How can I specify the toolboxes that my standalone application uses?
You shouldn't need any toolboxes to run a standalone application, that's the whole point of compiling it in the first place. ...

más de 11 años hace | 0

Respondida
nested function call using inputname crashes matlab
If the crash is not happening in debug mode, this implies that somewhere an event is not being flushed properly. Add a |drawnow...

más de 11 años hace | 1

Respondida
program not working in newer version of matlab
That is not a command that ships with MATLAB but rather one that you got from someone else or downloaded or wrote. On the machi...

más de 11 años hace | 1

| aceptada

Respondida
How to store value of rand() function in a file?
Or: matlab.io.saveVariablesToScript If you want a runnable script.

más de 11 años hace | 0

Respondida
Control errorbar width in Matlab R2014b
Pre-R2014b, this was possible because the errorbar series had children which were lines you could adjust. Since that's no longe...

más de 11 años hace | 4

Respondida
Slow or Laggy Matlab Workspace
Is your current directory either: # Full of thousands of files? # On a network? These two reasons are often the cause of ...

más de 11 años hace | 7

| aceptada

Respondida
How to delete a row by the last column variable
x(strcmp(x(:,end),'F32132'),:) = []; x of the rows with last column in x equal to 'F32132' set all columns to empty.

más de 11 años hace | 0

| aceptada

Respondida
Problem in convert cell to string.
S = reshape(A',1,[]) No reason to convert to and from a cell.

más de 11 años hace | 0

Respondida
how to emulate "hold on" in 2014b
<http://www.mathworks.com/matlabcentral/answers/165787-how-can-i-get-the-pre-2014b-behavior-of-hold-on> Or you can set the ax...

más de 11 años hace | 0

| aceptada

Respondida
Help me with matlab code
edit rank And see what it does.

más de 11 años hace | 0

Cargar más