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

11 years ago | 1

| accepted

Answered
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 ...

11 years ago | 1

| accepted

Answered
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...

11 years ago | 0

Answered
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...

11 years ago | 0

| accepted

Answered
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...

11 years ago | 0

Answered
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...

11 years ago | 0

Answered
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 ...

11 years ago | 0

Answered
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...

11 years ago | 0

| accepted

Answered
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...

11 years ago | 0

Answered
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*')

11 years ago | 0

| accepted

Answered
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...

11 years ago | 0

| accepted

Answered
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.

11 years ago | 0

Answered
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...

11 years ago | 0

Answered
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...

11 years ago | 0

Answered
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...

11 years ago | 0

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

11 years ago | 0

| accepted

Answered
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...

11 years ago | 0

Answered
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...

11 years ago | 0

Answered
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 ...

11 years ago | 2

| accepted

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

11 years ago | 1

Answered
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. ...

11 years ago | 0

Answered
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...

11 years ago | 1

Answered
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...

11 years ago | 1

| accepted

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

11 years ago | 0

Answered
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...

11 years ago | 4

Answered
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 ...

11 years ago | 7

| accepted

Answered
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.

11 years ago | 0

| accepted

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

11 years ago | 0

Answered
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...

11 years ago | 0

| accepted

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

11 years ago | 0

Load more