Answered
Help sifting through data in a 2D matrix
dn=datenum(y,m,d,c(4),c(5),c(6)); % convert to datenums w/ arbitrary y,m,d span=(dn(end)-dn(1))*86400; % time spa...

13 years ago | 0

Answered
How to write cell array of various data types to a text file using fprintf
OK, on the assumption your cell contents are something like >> c={'abc';'b'}; o={c; [2;23]} o = {2x1 cell } [2...

13 years ago | 0

Answered
Five plots arranged like on dice?
Either a) use subplot(2,3) and rearrange the two middle (make one invisible and move position of the second), or b) draw t...

13 years ago | 1

| accepted

Answered
How do I plot a signal over a duration of 1 second, with a = 200 and b = 0 for t<0.1 and a = 0 and b = 400 for t >=0.1
Just define a and b over the range of length(t) as well and use the 'dot' operators in the evaluation... a = 1000 and b = 0 f...

13 years ago | 0

| accepted

Answered
Plot with two Y-axis and logarithmix scaling
_y1,y2 should be plotted on the left Y-axis, which has a logarithmic scale. y3 then should be plotted on the right [linear] Y-ax...

13 years ago | 0

Answered
how to write exponents in axes?
Can't directly; the axis object doesn't use TeX interpreter. You'll have to use *text* w/ the right locations to write the de...

13 years ago | 0

| accepted

Answered
How to export a structure to a text file?
There is no builtin functionality that will do that transparently, unfortunately. You'll have to build the new file m = im...

13 years ago | 1

| accepted

Answered
What are 'R2' and MSe parameters for and how can I show them ?
See <http://en.wikipedia.org/wiki/Coefficient_of_determination> for a basic definition for R2. In short, R2=1-SSE/SST is ...

13 years ago | 0

Answered
Curve fitting: Getting very poor results on seemingly simple data set ("fit" function)
Your model without an intercept term doesn't fit the data pattern worth a hoot... With no intercept there's no offset to shif...

13 years ago | 1

| accepted

Answered
How to change the properties of legend?
From the doc for *legend* -- _LEGH = legend returns the handle to legend on the current axes or empty if none exists._ ...

13 years ago | 0

| accepted

Answered
How to get rid of zero values for if, str2double command
Preallocate with *nan()* instead of *zeros()*

13 years ago | 0

Answered
access the elements in a matrix given the column indexes
iy=[1 3 4]; ix=[1:length(iy)]; y=x(sub2ind(size(x),ix',iy');

13 years ago | 0

Answered
how to concatnate cells within a column
s=char(d.reg(1)); for i=2:length(d.reg) s=strcat(s,['||' char(d.reg(i))]); end Adding the "||" made trying to us...

13 years ago | 0

Answered
Can this function work any faster?
My simple-minded solution -- undoubtedly will need some robustness added, but try adding sophistication to something as trivial ...

13 years ago | 1

Answered
How to use xlswrite instead of fwrite ?
To use *xlswrite* would have to convert the input to numeric array and if is mixed won't work. Probably simplest if the above...

13 years ago | 0

Answered
R-square value of Probability plot
Doesn't appear that *probplot* returns anything but the handle(s) to the lines drawn; not the fitted parameters. You'll needs...

13 years ago | 0

Answered
Saving file in different directory than than loading dir.
There's no need to 'cd' at all...just build a fully qualified file name savdir = 'C:\Users\Jonasz\Documents\Studia_Biotechn...

13 years ago | 3

| accepted

Answered
How to generalize 2 dimensions into n dimensions with a for loop?
i1=min(x,[],2);i2=max(x,[],2); % the limits for conciseness n=repmat(20,size(x,1),1); % the number of poin...

13 years ago | 1

| accepted

Answered
How can i write this to a file?
You have to double-up the tic marks to include them. It's in the details of the doc for the various xprintf() functions... ...

13 years ago | 0

| accepted

Answered
Image of ideal particle
_...For example I do not understand the meaning of exist in the first code. What is it used for ?_ _I do not have a much time...

13 years ago | 0

Answered
differencing a time series
OK, presuming you have a vector of given length and the limits of the same, then (acf(k+1)<l(k)) || (acf(k+1)>u(k))) is ...

13 years ago | 0

Answered
How do I make a loop write to an asymetric pre-allocated array?
You didn't do much at all like I did, actually... :) The first case has identically the same problem as initially--you've got...

13 years ago | 0

| accepted

Answered
How do I make a loop write to an asymetric pre-allocated array?
x=[1:10]; %Excitation energies M=zeros(length(x)); %Preallocate array for i=x t = 1:10 M(i,:)= (3*...

13 years ago | 0

Answered
Plotting Issue with the specific type of plot having both axis, several legend type and value in output?
1. Just put x,y into an array or vector and array and call plot to start. Then add all the stuff you want. doc plot 2. ...

13 years ago | 0

| accepted

Answered
Resolved: Need help for using textscan to read a csv file
>> s='09FA20010524,09FA20010524,...,31.7778,36.2656,40.6526,44.9407'; >> fmt = [repmat('%s ', 1, 70) '%*[^\n]']; >> textscan...

13 years ago | 0

| accepted

Answered
Count all unique elements in a 3d matrix
Permutation on above... rpr=permute(r,[1 3 2]); r2d=rpr(:,:,1);for i=2:size(rpr,3),r2d=[r2d; rpr(:,:,i)];end u=unique(r...

13 years ago | 0

Answered
For loops are too slow
for i = 1:1:N for j = 1:1:norigin jstart = (j-1)*N + i; for k = nmin:1:nmax kend = jstart + k*N; ...

13 years ago | 1

| accepted

Answered
how to implement in matlab
Ohh....I think I finally figured out what want--the (variable) number of LSB(its) of the input value...ok, if interpretation is ...

13 years ago | 0

| accepted

Answered
How can I specify the memory when run programs?
_memory_ gives you the maximum amount of free memory at the time; how large an array can actually be created depends (as the not...

13 years ago | 0

| accepted

Load more