Community Profile

Suspensa Vix Via Fit

Contact

Top 1% contributor

I reject the label "expert", but here is my two cents worth anyway: * MATLAB has one great feature that very few programming ...

accepted

5

Answered 27 days ago

In <http://de.mathworks.com/matlabcentral/answers/175074#comment_264181 a comment> to my own comment (advising the OP to not use...

4 Answers

4

Asked 6 months ago

117 downloads

7 months ago

Unless you have good reasons to use cell arrays, then the simplest answer is to store your data in *one* numeric array and use t...

Answered 7 months ago

There are several natural order sort functions available on MATLAB File Exchange, but these all naively treat filenames as a sim...

9169 views

Responded 10 months ago

Ugh... bad idea! Avoid creating dynamically named variables in MATLAB. This is poor practice as has been explained many times...

Answered 15 days ago

Answered 25 days ago

Basically you should not do this. Using dynamically defined variable names or encoding data within the variable name is a pretty...

Try this: '1010' - '0' or equivalently: '1010' - 48

Answered 10 months ago

Thank you for editing your question and making it clearer. You can use <http://www.mathworks.com/help/matlab/ref/regexp.html ...

3

Answered 1 month ago

You can simply wrap the |strfind| inside |isempty|, like this: >> ~isempty(strfind('Schroedingers cat is alive!','cat')) ...

Answered 3 months ago

* Instead of concatenating file-paths together, you should use <http://www.mathworks.com/help/matlab/ref/fullfile.html |fullfile...

>> N = 6; >> pow2(floor(log2(N))) ans = 4 And it is even fully <http://www.mathworks.com/help/matlab/matlab_p...

Use <http://www.mathworks.com/help/matlab/ref/bsxfun.html |bsxfun|> for this: >> A = [1, 3; 4, 2] A = 1 3 ...

Both Geoff Hayes and Grieg have made some good points about simplifying the |if| statements, but it seems no one has addressed t...

Answered 5 months ago

If the |127x4| matrix is named |A|, then use mean(A) If you want to be more precise about which dimension it calculates ...

Answered 6 months ago

If you are talking about creating files with sequential filenames, these might be helpful to read: http://www.mathworks.com/m...

58 downloads

6 months ago

The documentation for <http://www.mathworks.com/help/matlab/ref/specialcharacters.html |[]|> clearly describes it as being a _co...

2

Answered 3 days ago

_"Is there any way to do it?"_ Of course, in principal any data with a known specification can be parsed by MATLAB. Is the...

The fastest that I could come up with is to avoid |accumarray| and stick with loops only... about ten times faster on my compute...

A search of MATLAB Answers for "Yosemite" brings up 179 hits: http://www.mathworks.com/matlabcentral/answers/?term=Yosemite&t...

*Intersection*: simply use <http://www.mathworks.com/help/matlab/ref/intersect.html |intersect|> with the |stable| option: ...

Here is a solution using no loops, and only <http://www.mathworks.com/help/matlab/matlab_prog/vectorization.html vectorized code...

Answered 2 months ago

It is likely that the data are <http://www.mathworks.com/help/matlab/matlab_prog/floating-point-numbers.html floating point> and...

This requires just *one* small change to the solution to <http://www.mathworks.com/matlabcentral/answers/195663-txt-file-to-matl...

That syntax is not MATLAB syntax at all: MATLAB <http://www.mathworks.com/help/matlab/ref/if.html |if|> does not use a |then| st...

Answered 4 months ago

It is not clear exactly what your question is: are you having difficulty reading this data from the file, or converting the text...

Use a <http://www.mathworks.com/help/matlab/cell-arrays.html cell array> like this: out = cell(1,max_trials); for trial ...

Use <http://www.mathworks.com/help/matlab/ref/dir.html |dir|> instead. If you only want to know about the _existence_, then you ...

Load more