Community Profile

Contact

Top 1% contributor

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

4 Answers

3

Asked 2 months ago

123 downloads

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

accepted

5

Answered 4 months ago

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

7975 views

Responded 7 months ago

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

4

Answered 3 months ago

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

Answered 7 months ago

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

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

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

Answered 6 months ago

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

2

Answered 13 days ago

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

Answered 18 days ago

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

Answered 20 days ago

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

If you know how many columns you want, then you can simply assign them in code like this: >> A = [1,2;3,4;5,6]; >> X1 = ...

Unlike numeric and character arrays, according to the documentation both structures and cell arrays _do not require completely c...

The code has multiple issues that need to be fixed. Here a a couple of things to improve: * The <http://www.mathworks.com/hel...

You gave this code in a comment to my other answer: size(f)==[1,350] size(r)==[50,50,900] for ii=1:350 for ...

You did not state in your question how you are runing this code, so I assumed that it is in a script. You can store the output o...

You could use my FEX submission |natsortfiles|: http://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filen...

To get the digits in a scalar numeric: >> x = 1.23456789; >> N = 4; >> n = fix(rem(x,1)*10^N) n = 2345 then to ...

MATLAB's feature called <http://www.mathworks.com/help/matlab/matlab_prog/vectorization.html vectorization> would be a great hel...

50 downloads

2 months ago

There is indeed a *very easy* and *very fast* solution: *better data management and planning*. Just because something is poss...

*Part One: Dynamic Fieldnames* This is called <http://www.mathworks.com/help/matlab/matlab_prog/generate-field-names-from-var...

1

Answered 5 days ago

Here is a general solution for matrices of decimal values arranged into any sequence. It uses MATLAB's rather powerful <http://w...

Answered 6 days ago

Indexed images also require the use of the |map| output of <http://www.mathworks.com/help/matlab/ref/imread.html |imread|>, whic...

This code reads the all eight lines of your sample file correctly, including those pesky missing data: fid = fopen('123.csv...

Answered 8 days ago

The trick to including different-length columns into a matrix is to define the <http://www.mathworks.com/help/matlab/math/matrix...

Answered 10 days ago

You can use <http://www.mathworks.com/help/matlab/ref/diff.html |diff|> to calculate the differences of adjacent matrix elements...

Answered 11 days ago

Doing this in a loop and concatenating new values into a vector is very poor use of MATLAB, and will be <http://www.mathworks.co...

Answered 17 days ago

Load more