Answered
How do I find the maximum and minimum of a histogram in MATLAB?
doc min % and/or max Look at alternate (optional) returns.

13 years ago | 0

Answered
Mean value of data with irregular intervals
One way to weight uniformly... dx=min(diff(x)); % shortest difference in vector xi=x(1):dx:x(end); % fill ...

13 years ago | 1

Answered
Error showing as using too many output arguments.How to solve this?
Format the rest of the code for legibility and provide the actual line and error message as seen on the screen to pinpoint where...

13 years ago | 0

Answered
how can i use linspace to generate a row vector with two similar points?
bp=16; % breakpoint value sp= 2; % startpoint ep=20; % endpoint a0=[linspace(sp,bp,N1) linspace(bp,ep,N2)]; N1, N2...

13 years ago | 0

| accepted

Answered
writing a code for DFT without using built-in functions
doc times Since you say this is your first experience w/ Matlab, I suggest starting at the beginning of the online doc's are ...

13 years ago | 0

Answered
Error using textread to read data containing "INF" or "NaN" with float data
[d1,counter,...,IR01DnCo] = textscan([direct filename], ... _On running the script I get the following error; Error usi...

13 years ago | 0

Answered
How can I find the maximum absolute value between two zeros ?
Updated version that also returns locations in original vector. I did for simplicity restrict the input to a column vector; jus...

13 years ago | 1

Answered
reading a specific table out of txt file
If the 25 header lines is consistent, it's trivial; otherwise you'll have to have _something_ that is consistent-enough to searc...

13 years ago | 1

Answered
finding the location of the maximum of N periods
OK, for "dead ahead" loop solution is fairly trivial--it didn't come to me otomh on vectorizing this owing to the indexing being...

13 years ago | 0

Answered
Error using textread to read data containing "INF" or "NaN" with float data
Here's a case where the "red-haired stepchild" status of *textread* hurts--it can't accept a custom 'TreatAsEmpty' string proper...

13 years ago | 0

Answered
Numerical analysis please help
Replace the loop structure i=1; for q=0:0.05:4; x(i)=q; s(i)=quad('sin(x.^2)',0,x(i)); c(i)=quad('cos(x.^2)...

13 years ago | 0

Answered
Have an error in code
Wherever in your script you've defined all of the pertinent inputs for the function and wish to compute the results, then simply...

13 years ago | 0

Answered
Have an error in code
clear, clf format short ... % more script code ... for i=1:Vertices for j=1:(i-1) if Adj_Matrix(i,j)~=0 ...

13 years ago | 1

Answered
Urgent: How do I perform FFT on a time signal
doc fft Sampling frequency is set by the hardware, time then determines the length.

13 years ago | 0

Answered
How to create user input files using Matlab
A) There are several choices w/ Matlab -- you can build applications and create compiled apps that you can distribute which sort...

13 years ago | 0

Answered
How to set the data from file
ndata=load(file name) ndata=[zeros(1,size(ndata,2); ndata]; % prepend row of zeros time=indata( : , 1); ... Note the ...

13 years ago | 0

| accepted

Answered
bar chart xtick position
OK, the above will work... % some sample data... >> b b = -0.4023 0.4081 -0.3920 0.0170 >> b1=b;b1(b1>0)=nan...

13 years ago | 0

Answered
use fprintf to write to a new file
_...first I opened my source file via_ fid=fopen('source.dat') data=fscanf(fid, ... % get the data fid=fclose...

13 years ago | 0

| accepted

Answered
How do I create this scatter plot?
gscatter(mydata(:,1),mydata(:,2),ordinal(X(:,11)),'bg','+.'); doc gscatter Caution--air code but should be close. Ord...

13 years ago | 0

| accepted

Answered
use fprintf to write to a new file
fid=fopen('source.dat') % do some stuff to the (presumed read but unshown) data from 'source.dat' result=fopen('result.dat',...

13 years ago | 0

Answered
what will be code for finding value of y1,y2,yy1,yy2 for x= 2.08,2.085 exactly from arbitrary data set given as?
doc interp1 >> [x y1 y2 yy1 yy2] ans = 2.0795 0.0987 0.0836 0.1538 0.1742 2.0803 0.0983 0.08...

13 years ago | 0

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

13 years ago

Answered
How important is it to use power of 2 when using FFT?
A) The phase is representative of the sample phase; if the two samples are collected w/o a specific triggering then they will no...

13 years ago | 2

| accepted

Answered
bar chart xtick position
Unfortunately, the axes object has only two values for the [x|y]AxisLocation property -- Top/Bottom; no Origin choice is availab...

13 years ago | 0

Answered
Voltage Measurement block error
Make the proper connection... No can help w/o any other info--the message says the 2nd of the three inputs isn't actually con...

13 years ago | 0

| accepted

Answered
How to extract specific data from one dimension of a 3D variable?
Not quite sure I follow -- 'z' is an elevation, not a pressure, correct? And all values in P are pressures? But, presuming is...

13 years ago | 0

| accepted

Answered
How can I find the maximum absolute value between two zeros ?
OK, I can't seem to find a utility I had that does basically what you were/are looking for that I thought was around but here's ...

13 years ago | 1

| accepted

Answered
Using FSCANF to read and extra data into matrix
fmt=[repmat('%d %*s',1,3) '\n']; A = fscanf(fid,fmt,[3,inf])';

13 years ago | 1

| accepted

Answered
Single versus double precision, what's going on here?
Hint--(a very large one :) ) single(550000000)+single(5000000)+single(200000)+single(18300) ans = ???

13 years ago | 0

| accepted

Answered
How to write a file with strings and numbers
If the names are known and fixed, it's simple enough to just write them literally. If, otoh, it's more general than that you ca...

13 years ago | 0

Load more