Answered
Obtain equation for a curve of best fit
subplot(2,1,2), plot(fitobject1(wavelength1)) is plotting against the ordinal number of the array; to just plot over the ra...

10 years ago | 0

Answered
xlswrite not writing few entries
From doc xlswrite ... Input Arguments ... A — Data to writematrix | cell array Data to write, specified as a two-...

10 years ago | 1

| accepted

Answered
Importing rows with empty cels from EXCEL
With *xlsread* alone the only way is to specify the range and return the raw data cell array. There may be a way with the COM/D...

10 years ago | 0

Answered
Improve the code's time of execution. I want to avoid the for loops and use element by element calculations. Do you guys have something in mind?? Thank you in advance.
See if the following produces correct output, first; should reduce the time slightly by eliminating redundant tests and shorteni...

10 years ago | 0

| accepted

Answered
Trying to handle a large matrix of nx101 dimensions where n is unknown at start of loop, and I only need the previous vector to calculate the current vector
The primary one is to preallocate the array and populate rather than augmenting it. That is, start by N=1000; ...

10 years ago | 0

Answered
Issue with different length of columns in a matrix.
_"length of the columns of the matrix(eg: x & y columns) vary"_ is _not_ so; there will be however many of each as there are num...

10 years ago | 1

Answered
Custom labels for the axes - Problem when expanding window
If the data to plot are x = [10,20,30] then why are you setting _'xticklabel'_ at all? Just let the automagic tick values refle...

10 years ago | 0

Answered
Is there any method to perform differentation of function (say f(x) =3x^2-5x-2) without Symbolic Math Toolbox?
doc polyder % for polynomials Else't you'll need to know something of the functional form to know the functional form of t...

10 years ago | 0

Answered
fgetl skipping empty lines and text lines
No looping needed...as long as the numeric values are regular (ie, same number of columns each record) as shown. >> c=textr...

10 years ago | 0

| accepted

Answered
May i ask how to know the frequency content from fast fourier transform? because i can't understand clearly from graph...Can the data from graph show in numbers?
The example of single-sided amplitude spectrum at doc fft shows clearly how to get the associated frequency axis on a pl...

10 years ago | 0

| accepted

Answered
Error using reshape with file input
With the other comments that we're "flying blind" not being able to see the input file structure, the first issue is that ...

10 years ago | 0

Answered
How to create the Hex format of the address below in MATLAB?
FAddrMax = 8389; BitMax = 1311; k=0; for i = 0:FAddrMax for j = 0:BitMax k=k+1; ...

10 years ago | 0

Answered
Storing values from for loop in array and calling functions
If you've got _SimNumber_ simulations and each is _n_ by 5, then the total output needs be-- AllSimData=zeros(SimNumber*n,5...

10 years ago | 0

| accepted

Answered
Hi everyone. I want to create a new matrix using a rand function and the values of other matrix.
IMIN=t(:,1); IMAX=t(:,2); pdf=bsxfun(@plus,IMIN,bsxfun(@times,(IMAX-IMIN),rand(p,100))) You can dispense with the int...

10 years ago | 1

| accepted

Answered
How to extract differnt size submatrices out of a larger one using a for loop?
Presuming the answer to question above is "yes", you've got the right idea; as for processing multiple you simply make the ID a ...

10 years ago | 0

| accepted

Answered
Undefined function 'mtimes' for input arguments of type 'struct'. Error in @(a)T*a*T' Error in blockprocFunDispatcher (line 13)
You must reference the structure field content to have an array as input to the function. Example... >> s.x=rand(2); % c...

10 years ago | 0

Answered
if i have two matrix how can make them same size by add zero column or row ?
doc size doc zeros Read "Getting Started" section of documentation and work thru the tuorials on basic Matlab syntax and...

10 years ago | 0

Answered
How do I index into a matrix with a vector to extract the jth column for each row?
>> A(sub2ind(size(A),[1:size(A,1)],ii)) ans = 16 11 9 14 >>

10 years ago | 0

Answered
What is the highest order polynomial I can use in the polyfit function?
_"... larger order than 85, such as 95, it returns the polynomial's coefficients as NaN"_ Yeah, what is your range of x and w...

10 years ago | 0

Answered
Plotting temperature vs date, which will be a combination of two array?
dates=datenum([finalmonth,finalyear]); isn't correct form for *datenum*, _"...A partial date vector has three elements, spe...

10 years ago | 1

| accepted

Answered
How to make multiple columns one below the other making it one column?
x=xlsread('data.xls'); x=x(:);

10 years ago | 1

| accepted

Answered
How to use least square fit in matlab to find coefficients of a function?
Matlab to the rescue!!! :) One of the most usefulest features, indeed! >> x = [7.38, 5.86, 2.46, 6.66, 0.83, 6.26, 6.61, ...

10 years ago | 2

| accepted

Answered
How can I find the first 1 value in my binary matrix?
So what was wrong with Bruno's FEX solution? But, another solution from those posited there... >> A = randi(2,5)-1 A = ...

10 years ago | 0

Answered
How to split cell array separated by ',' into double array?
>> c={'0,0,0,2,2,0.39,0.49' '0,1,2,2,2,0.34,0.44'}; >> str2num(char(c)) ans = 0 0 0 ...

10 years ago | 0

Answered
if i have matrix how to do this operation on it ??
>> m=5; n=length(A); % define sizes >> F=zeros(n,m); % preallocate output >> ix=find(sum(A,2)+sum(A~=0,2)-1=...

10 years ago | 0

| accepted

Answered
How can I convert a row with serial numbers and entries into two columns with serial numbers and data in a .txt file?
>> reshape(x,2,[]).' ans = 1 0 2 0 3 1 4 0 5 1 >>

10 years ago | 0

| accepted

Answered
Save each loop values, without overwriting
for j=2:25 QQ=MND(:,j-1); %m3/s Vector containing fixed nodal discharges with each PF [Y,Df,Q,VK1,Vn1]=funF2(H,QQ,MT...

10 years ago | 0

Answered
Assigning a variable to any value in a matrix
Matrix = [0 1 4; 4 1 3]; for x = 1:10 if any(x+Matrix(:)==5) ... *NB:* use of *:* to treat array as a vector...

10 years ago | 0

Answered
ismember function and find function in the matlab is not responding for some values? Please check this issue and guide me..Only for 3.3500 value is is giving 0 answer.
See the FAQ topic <http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F <Why is 0.3-0.2...

10 years ago | 0

| accepted

Answered
What is meaning of c(:,1) and . in matlab code
See <http://www.mathworks.com/help/matlab/learn_matlab/matrices-and-arrays.html <learn_matlab/matrices-and-arrays>> and <http:/...

10 years ago | 1

Load more