Community Profile

Contact

Top 1% contributor

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

accepted

3

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

1 month 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 2 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 3 months ago

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

Answered 4 months ago

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

2

Answered 1 day ago

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

Answered 3 days ago

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

With your particular example: numheaders = 1025; header = arrayfun(@(n) sprintf('psb_%d', n), 1:numheaders, 'UniformOutp...

The reasons that using |eval| is frowned upon is that # you don't get automatic syntax check in the body of the eval, # it c...

How about: m = circshift(eye(numel(h) + 1), 1, 2) m(end, 2:end) = h;

This is possibly what you want: for ... for ... mycells{k, f} = [mx{k,f}; kron(mk{k, f}, ones(4, 1))]; en...

Using the new |histcounts| (it works the same with |histc|) m=[1 2;2 5;4 7;5 10;6 9;3 3] [~, ~, indices ] = histcounts(m...

Nearly there. Use cell arrays for storing your images or a 3d matrix: thld = 0 : .001 : .5; for idx = 1:numel(thld) ...

Just get all the files in the directory and keep only the ones with the extensions you want. You could even get the list of all ...

1. Preallocation does not save any memory. It will save time 2. Put a semicolon at the end of your _x(k) = x(k-1)+5_ line an...

Use a <http://www.mathworks.co.uk/help/matlab/ref/try.html try catch> to catch the error and respond appropriately to it: c...

Yes, test to see if nargout is 0 and if it is don't assign anything to any of the outputs. You'll have to rejig your code to use...

Even if _Im{:}(:, 256)_ was valid matlab syntax it still wouldn't work as _plot_ expects a pair of x and y coordinate for each l...

Load more