Answered
Label x-axes by fraction
Plot first, _then_ set axis properties to other than default ones... XTicks=flip(1./(2:20)); XTickLabel=flip({'1/2','1/3...

10 years ago | 2

| accepted

Answered
How can I control a GPIB device's parameters from GUI?
Sure, just build a command string to send...but in query(g1,'CTRWL handles.CWL') the 'CTRWL handles.CWL' is a literal st...

10 years ago | 1

| accepted

Answered
how to plot a spreadsheet in 3D
You can try *surf* but unless you have data in a regular grid, Matlab surface plotting routines are exceptionally weak; in that ...

10 years ago | 0

Answered
I keep on getting the response: "Error using * Inner matrix dimensions must agree" when running a script. Any Idea on what to do?
_"In a while loop... v=((sqrt(T)*tanh((sqrt(T)*sqrt(0.5*Cd*A*rho-fr*t))/Ma))/(sqrt(0.5*Cd*A*rho-fr)));"_ But _v_ and _t_...

10 years ago | 1

Answered
Writing the column vectors of matrix X into individually specified columns of matrix Y
Oh, probably with great obfuscation but if you'll preallocate _Y_, I'd expect the loop would be quite fast enough...

10 years ago | 0

Answered
Saving function variables without evil eval
Just *save* then *load* will do all automagically...see doc save % for details

10 years ago | 3

Answered
Index a percentage of a Matrix
85% of what--the indices, the values, ...? And, if it's is a matrix, what about shape? Matter where they came from or just ove...

10 years ago | 0

Answered
How can i restore complex numbers from abs(fft)?
_"In short, How can i restore complex number?"_ In short, "you can't" once you've thrown away the separate magnitude and phas...

10 years ago | 0

| accepted

Answered
Filtering a wind direction vector by a wind magnitude vector?
Use logical addressing... ix=(wndSpeed>=5.0); data=[wndSpeed(ix) wndDirection(ix)]; % keep desired Use time vector s...

10 years ago | 0

| accepted

Answered
Plotting data with timestamps
Convert from whatever format the timestamps are in to a Matlab representation of dates...with R2014 up, there's the _datetime_ c...

10 years ago | 1

| accepted

Answered
Automatically detect last row of CSV file with dlmread
With a sequential file, "no, not really". It'll likely be just as fast to read the whole file every time and discard all except...

10 years ago | 0

Answered
How to calculate percentage increase in MATLAB?
>> v = [2518629;2755823;2981659;3334874;3692492;4068109;4434682;4830979;5263593;5674380;6070581;6453628;6909000]; >> [v(2:en...

10 years ago | 1

| accepted

Answered
In a CSV file there are around 200 values (200*1) matrix form. I want to take a particular value which is repeated more than other values. How will I be able to take this.
_"...get this number (5) from a CSV file and import to matlab."_ Backwards thinking--first *read* the file, _*then*_ find the...

10 years ago | 0

Answered
How to find indexes of 10 maximal valuse in a given NxN (symetric) matrix?
Always just try the straightforward solution first-- nMax=10; [~,ix]=sort(c(:),1,'descend'); [i,j]=ind2sub(size(c),ix(1:...

10 years ago | 0

| accepted

Answered
How to calculate moving average excluding current data?
N=20; % number above/below midpoint u=[ones(1,N) 0 ones(1,N)]/(2*N-1); % weighting mAvg0=...

10 years ago | 0

Answered
variable section value give me some mean value but std is zero
You've double-compensated for the 2D image in im = double(im(:)); m=mean(mean(im)); s=std(std(im)); _im_ is now a...

10 years ago | 1

| accepted

Answered
How do you plot a data set with black crosses and a red line connecting them
hL=plot(randn(10,1),'r+-','markeredgecolor','k');

10 years ago | 0

| accepted

Answered
Read .csv file with whitespace in complex number using textscan
You can do all in Matlab by first reading full file as *char* array and doing a string replacement for the ill-formed blank betw...

10 years ago | 0

| accepted

Answered
extract value at a specific location
Tst=interp2(T1,lon_desired,latitude-desired) Don't supply the coordinates of the reference T array so the values requested ...

10 years ago | 0

| accepted

Answered
uniform distribution between a and b with intervals of 0,005
Well, I'd guess so...that wouldn't be very random at all...but, the simple-minded approximation would be >> N=10; >> n=r...

10 years ago | 0

Answered
Transpose... Not Transposing!
I'm quite certain Matlab is _not_ "not transposing"; symptom sounds to me as though likely you're alternating operating on a row...

10 years ago | 1

Answered
in order to plot in 3D, which method to read the data is best? fgetl, fscanf, or textscan?
What defines "best" for reading data is the input form of the data file, not the end result (although of the above, *fgetl* is p...

10 years ago | 0

Answered
Scatter of response data against time and trial number. Differences in vector size.
IIUC, either # use *hold on* after plotting first, then add the others, or # fill in the shorter vectors with NaN as placeho...

10 years ago | 0

Answered
Why does an if-structure exceed the given limit?
Welcome to the wild and wacky world of floating point arithmetic! 0.1 isn't exactly representable in binary (it's a continuing ...

10 years ago | 0

| accepted

Answered
What is the right way to put a polynomial into a function?
_"the polynomial ... is: c(0) +c(1)x^1 +c(2)x^2+...+c(N)x*N"_ y=polyval(fliplr(c),x); Better would be to define your coe...

10 years ago | 0

| accepted

Answered
Trying to write each iteration of a for loop into Excell
Use the vector, Luke! :) "The Matlab way" is to avoid looping when unneeded-- Yb=Y1+[-20:80].'; % NB: transpose...

10 years ago | 1

Answered
How do I fit to 2D data using a custom function defined in a separate file?
*fittype* tries to be too clever by far, imo. By default, _"x is the independent variable, y is the dependent variable, and all...

10 years ago | 0

Answered
a a aa a
If have Stat Toolbox, use *crosstab* with the variables as grouping variables.

10 years ago | 0

Answered
How to return the row vector containing the highest values from a matrix?
Sort first by row (already done here in these examples), then by column, retaining the sort index. Then (I think, altho didn't ...

10 years ago | 0

Answered
How can I sum daily files over different years to quarters?
Read in the directory of all files and use regular expressions or string comparison to find those locations containing 01 thru 0...

10 years ago | 0

Load more