Answered
How to make script look for specific files for processing?
Sure, if you can develop the pattern, you can generalize it... for LFAfile={'0W_1pc','0W_2pc','0W_3pc','0NoC_1pc','0NoC_2pc...

12 years ago | 1

| accepted

Answered
How to call function on each element in structure
D = rdir('./*/forces.dat'); % Here comes the trouble for i = 1:length(B) [t{i},pfx{i},...,torque{i}] = importForce...

12 years ago | 0

| accepted

Answered
Commands faster in one line
Because at the command line each _line_ is parsed and the JIT compiler/optimizer is pretty much disabled. In an m-file, the fil...

12 years ago | 2

| accepted

Answered
Interpolating a double array
Presuming you have x,y in order to have generated the plots (if not, simply retrieve _'x|ydata'_ from the axes) A) xi=li...

12 years ago | 1

Answered
Exporting multiple CSV's
<http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F> This specifically addresses creating _input_ file...

12 years ago | 0

| accepted

Answered
plotting wave heights next to dots on a matlab plot
You might look at doc scatter As for the labelling, text(xx,y+dy,num2str(height,'%.2f'),'horizontal','center','ver...

12 years ago | 1

Answered
Sorting data from time stamp in excel
Why do you need separate columns--what are you going to do with them? If you think you must, use *datevec* to parse the strin...

12 years ago | 0

Answered
dlmread and textread , which to choose when reading lots of .txt files storing numeric data ?
Can't say a priori, time a couple typical files and see...if I had to just make a guess, I'd place the money on *textread* by a ...

12 years ago | 0

| accepted

Answered
Generating random number between 1 to 10
That's "sampling w/o replacement". One relatively simple way-- N1=1; N2=10; % range desired p=randperm(N1:N2); for...

12 years ago | 0

| accepted

Answered
How to find the maximum after every 5 rows in a matrix?
nGrp=5; % grouping size mx=reshape(nanmax(reshape(x,nGrp,[])),size(x,1)/nGrp,[]); The key is to remember stor...

12 years ago | 0

Answered
What is the difference between fopen( 'r'),fopen('r','b') ?
Storage order in memory of which byte in memory is the most/least significant. See the following link for details... <http:/...

12 years ago | 1

| accepted

Answered
not entering nested for loop
s=1; value=0; for l=178:184 for i=224:218 value(s)=mat(m,l); if value(s)~=0 && value(s)~=12 ...

12 years ago | 0

Answered
arrangement problem with writing cellArray to txt file.
>> [nr nc]=size(cellArray); >> fmt=['%5s' repmat('%8.3f',1,nc) '\n']; >> for i=1:nr fprintf(fmt,cellArray{i,1},[...

12 years ago | 0

| accepted

Answered
Explanation of this statement
Did you just look and see??? But, yes, you're evaluation is correct of the code as written--now whether that's what was intende...

12 years ago | 1

Answered
Utilizing Matlab for 2 "for loop" calculation
Presuming only the last result is actually needed... [x y]=meshgrid(1:M,1:n); result=func2(x,y,func1(x,y));

12 years ago | 0

Answered
Function parameters as switch/data pairs?
_...wrongArray is not the data structure that the 'target' operations is intended to operate on, either because it contains the ...

12 years ago | 1

Answered
How to Add the Individual digits of a result ?
Lots of ways...just a couple-- >> sum(str2num(num2str(789*4567).')) ans = 24 >> >> sum(sscanf(num2str(789*4567),'%1d...

12 years ago | 2

| accepted

Answered
How to build a number generator allowing to get any desirable signal distribution?
Basically, you have to have the inverse distribution function and then it's "trivial"... <http://www.av8n.com/physics/arbitra...

12 years ago | 1

Answered
how to use the state of random number seed
Retrieve the _savedState_ structure and begin the script with resetting to that condition. The example of *randstream* demonstr...

12 years ago | 0

Answered
Cannot get XLabel by Child accessing of gca
The children of the axes are the line(s) while xlabel is a property which holds the handle of the text label object. Until modi...

12 years ago | 1

Answered
Writing to .mat files
See doc save especially the _-append_ keyword. You'll find using the command form of the function call much more amena...

12 years ago | 0

Answered
please help i am having a problem debugging my code. the error is Function definitions are not permitted in this context.
You _must_ put the code for the function emd in a file named emd.m The first line in the file is the function definition line. ...

12 years ago | 1

Answered
How to convert a column into equal columns
>> reshape(reshape(sortrows(d,1),3,[]).',3,[]) ans = 1.0000 0.2000 1.0000 0.3000 1.0000 0.1000 2.000...

12 years ago | 1

Answered
Anybody w/ new release since R2012b test for resolution of fixed-width field?
Well, talk about timing and coincidence!!! Just a few hours ago another query of the nature was posed at <http://www.mathwor...

12 years ago | 2

Answered
read ascii non-delimited file
I see IA answered the problem about opening the file; that's just the beginning as Matlab has no way to read a nondelimited, fi...

12 years ago | 1

Question


Anybody w/ new release since R2012b test for resolution of fixed-width field?
<http://www.mathworks.com/matlabcentral/answers/120549-extract-value-from-txt-weird-lay-out> I created a Service Request from...

12 years ago | 2 answers | 3

2

answers

Answered
Help defining this variable?
bac12=data(:,2:3);

12 years ago | 2

Answered
Help plotting some data?
_... plot the day vs the bacteria counts..._ Day vs counts or counts vs days??? Either way, simply either a) read first...

12 years ago | 1

Answered
How can i write an equivalent GO TO statement in MATLAB
The best solution is to understand the function thoroughly enough to simply rewrite it in Matlab syntax. Alternatively, to tran...

12 years ago | 1

Load more