Community Profile

Top 1% contributor

The only difference between |if ... elsif| and |switch ... case| is one of clarity. It shouldn't make much difference in term of...

accepted

4

Answered 18 days ago

Another question inspired by the <http://uk.mathworks.com/matlabcentral/answers/?s_tid=gn_mlc_an answers forum>: A vector of ...

Solve this!

5

4 months ago

By default, a listener callback does not trigger its own event. You need to change its <http://www.mathworks.com/help/releases/R...

3

Answered 13 days ago

Of course, there is, use the two output version of <http://www.mathworks.com/help/releases/R2014b/matlab/ref/find.html |find|>: ...

Answered 1 month ago

Your array |l| has one more element than |z|. why? Anyway, z = 1:9; l = [1 2 -3 4 -5 6 7 -8 9]; negposition = find(l ...

<http://www.mathworks.com/help/releases/R2014b/matlab/ref/unique.html |unique|> will give the unique years, and its third return...

Do you really have a numeric value in one of the cell of your cell array? Anyway, <http://www.mathworks.com/help/releases/R20...

In term of performance |arrayfun| is probably slightly slower than a loop due to the overhead of the function call. So, don't ch...

Answered 3 months ago

You're already using |uint8| to store your values. There isn't a smaller type unless you start packing booleans into bits which ...

Answered 4 months ago

It sounds like you're trying to implement a numeric class. So I'll refer you to <http://www.mathworks.co.uk/help/matlab/matlab_o...

Answered 5 months ago

Perhaps, this is what you want to do: classdef Parent < handle properties (SetAccess = private) name = ''; c...

Answered 6 months ago

Possibly, you have a variable in your workspace called |msgbox|. What does which msgbox returns? Note that you may r...

2

Answered 5 days ago

This is a copy of the answer I wrote in the comment to my answer of <http://www.mathworks.com/matlabcentral/answers/183947 your ...

Answered 7 days ago

_I have to keep it in a cell format_ Why? If it's a cell array of scalar, a matrix is a lot more efficient. There are seve...

Your image is of type uint8 which is an <http://www.mathworks.com/help/releases/R2015a/matlab/matlab_prog/integers.html integer>...

Answered 17 days ago

<http://www.mathworks.com/help/releases/R2015a/matlab/ref/timeseries.plot.html |plot|> for timeseries is actually a different fu...

As Brendan has stated in his comment, matlab is exclusively pass by value. A function always receive a copy of the input argumen...

On Windows, on a computer with .Net, this may work: args = System.Environment.GetCommandLineArgs; fullpath = args(1); ...

Answered 19 days ago

Common practice for |switch| statements like you have done is to use the same output variable for all the cases. So instead of: ...

|contains| is not a standard matlab function. You can test set membership wih <http://www.mathworks.com/help/releases/R2014b/mat...

Answered 21 days ago

It's not possible to do what you want with just a regular expression. A character can only be part of one match, so once you've ...

Answered 23 days ago

C = {zeros(3); [1 0 1; 0 0 0; 1 0 1]}; X = [1 1 0; 0 1 0]; %current matrix X = cell2mat(C(X+1)) %new matrix

Answered 30 days ago

All of the solution proposed so far have the problem that they'll find the hashtag |#retro| in the hashtag |#retrorocket|, which...

I believe it's explained somewhere in the doc about classes. Whereas in C++ the object is passed implicitly to the methods of...

As per the <http://www.mathworks.com/help/releases/R2014b/matlab/ref/system.html#btn2f1p-7 tip section |system|'s help>: _to exe...

Assuming your |x| is monotically increasing (if not, |sort| it and save the original indices to reorder the data at the end), an...

It looks like your hexadecimal values are the representation of a *single precision* <http://en.wikipedia.org/wiki/IEEE_floatin...

|:| is the <http://www.mathworks.com/help/releases/R2014b/matlab/ref/colon.html colon> operator. As per the documentation: A...

Surprisingly enough, |strfind| works on numerical arrays as well and does exactly what you need: x = [4 3 1 7 36 4 2 3 1 2 ...

The error is |Undefined function or variable 'files'|. |files| is defined inside your |for| loop. So if it is undefined after th...

Answered 2 months ago

Load more