Community Profile

Top 1% contributor

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

accepted

3

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

Answered 21 days ago

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

Answered 27 days ago

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

Answered 28 days ago

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 1 month 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

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

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

2

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

Answered 11 days ago

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

Answered 12 days ago

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

Answered 15 days ago

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

It looks like all you want to do is rearrange columns and change the row names. So the simplest thing is to load your text file ...

Answered 2 months ago

Funnily enough. <http://www.mathworks.com/help/releases/R2014b/matlab/ref/size.html |size|> is the function to get the size of c...

A date number (serial) has to have a day (and hour, minutes, seconds, if not given, the default is 0:0:0), so use the first of t...

Don't store these submatrices in individual variables with different names.Rather store them in a cell array. Use <http://www...

Possibly, this is what you want: g1 = randi([-100 100], 5, 4); %example data, a 5*4 matrix g2 = randi([-100 100], 3, 4)...

Don't use |ActiveWorkbook| and |ActiveSheet|, instead use the objects returned when you open the workbook / access the sheet: ...

If you don't save the workbook and don't quit excel, the workbook will remain open in excel and be left read-only by excel, thus...

It's not easy to understand what you're asking without an example. Does <http://www.mathworks.com/help/releases/R2014b/matlab...

I don't know if it's any faster ( _edit: yep, much faster 8 ms vs 4.4 s_) but your whole code is equivalent to: EH = max(H ...

Matlab is hopeless with COM enumerations, they don't get imported. As a result instead of using the enumaration names, you have ...

Pam, I think you should grab a good introductory book on matlab or go through the tutorials in the help and on Mathworks web...

Maybe I'm misunderstanding something but to me it looks like your code is wrong, it's missing for ex. |0 1 0 1| as an output. ...

Load more