Answered
Finding intersection of polyfit and line
Doesn't do any good to fit the data but not save the coefficients of the resulting fit... b=polyfit(l,FS,3); % Get coef...

11 years ago | 0

Answered
how to re order a matrix based on a vector ?
Clearly you haven't tried the obvious... >> A(:,t) ans = 2 16 3 13 11 5 10 8 7 9...

11 years ago | 2

| accepted

Answered
How to generate samples from a cauchy distribution
a_c1ovrc2( :, ~any(a_c1ovrc2,1) )= [] _"in order to delete all the unnecessary zero columns(I don't understand why they we...

11 years ago | 0

| accepted

Answered
Problem with renaming dublicated variablenames
ppn=strcat(ppn,'_01'); % add the '_01' at the git-go... [~,~,ib]=unique(ppn); % get a list of unique name positions [...

11 years ago | 0

Answered
Lookup values in other matrix
>> v1={'Math'; 'Chem'; 'Bio'; 'Chem'; 'Chem'; 'Math'}; >> v2={'Baseball' 'Tennis' 'Soccer' 'Tennis' 'Tennis' 'Baseball'}.';...

11 years ago | 0

| accepted

Answered
How do I declare a variable non-automatically on Matlab?
Don't have the coder to test, but how about >> B=struct('obs',0,'cust',0,'visit',0) B = obs: 0 cust: 0 ...

11 years ago | 0

Answered
How to pull similar data from different sized matrices?
Not sure where the problem lies, exactly, or the actual question but--- set1=set1(iswithin(set1(:,1),3,9),:); will turn ...

11 years ago | 0

| accepted

Answered
plot unequal length vectors
All you can do there is create some mapping of an X value for each Y; it makes no sense otherwise other than simply by ordinal p...

11 years ago | 0

Answered
Error using textscan Badly formed format string??
formatSpec = '%{yyyy-mm-dd HH:mm}D%f%f%f%f%f%f%g%{^\n\r}'; The curly brackets don't belong around the trailing %{^\n\r} to ...

11 years ago | 1

Answered
How can I count it by months?
This will be _much_ easier if you convert the month, day columns into date numbers. I don't have the newer table by which you c...

11 years ago | 0

Answered
I am looking for a vb.net example that writes .mat files. What Matlab file references are required?
<http://www.mathworks.com/help/matlab/read-and-write-matlab-mat-files-in-c-c-and-fortran.html read-and-write-matlab-mat-files-in...

11 years ago | 0

Answered
How to store the solution in to .txt file?
There are a "veritable plethora" of ways to create a text file in Matlab...which is most suitable depends on what your data actu...

11 years ago | 1

Answered
make calculations with excel file data
"_Is the same calculation for all...of the column 8."_ Tf=a(:,8)*1.8+32; % convert column 8 (assume T in C) to F Done f...

11 years ago | 0

| accepted

Answered
How to identify the approximate value from two different vectors?
Assuming the above comment is true... >> interp1(B,B,A,'nearest') ans = 14.4400 14.1200 90.4190 90.8500

11 years ago | 0

Answered
Problem with ''mode'' function in matlab
>> x=uint8(randi(244,10)); >> mode(x(:)) Error using mode (line 56) X must be an array of double or single numeric values. ...

11 years ago | 2

| accepted

Answered
Plotting figures using figure handles
Once it's closed, it's gone and the handle, despite the variable still holding the value, is bogus. Only replotting from the ...

11 years ago | 2

| accepted

Answered
counting column bits with the same weight in binary array
n=hist(sum(array),0:size(a,1)); N _th_ element of n will contain counts for that number of bits from zero to size(array,1);...

11 years ago | 1

| accepted

Answered
Changing number of dates shown on xaxis
I had presumed the '2' was intended as '20' but had to go to lunch so Star beat my example :) But, the following that had prep...

11 years ago | 0

| accepted

Answered
Scalar Error bars???
As similar to the example in the documentation, E = 0.371*ones(size(x));

11 years ago | 0

Answered
polar coordinates to Cartesian coordinates.
doc hough ... The function returns ... the angle in degrees between the x-axis and this vector. doc pol2cart ......

11 years ago | 0

Answered
How to define the upper limit of y-scale in a log plot
You don't give any data nor attach a plot to see the issue specifically, but you set fixed axes limits on log axes the same way ...

11 years ago | 2

| accepted

Answered
Bar Plot with 2 Y axes and same X- axis
Since the two calls to *bar* in *plotyy* are independent of each other, there's no way for the information that you want two ind...

11 years ago | 0

| accepted

Answered
Extracting Table Data by Date
Yes, but it'll be easiest if you add a column that stores the datetime number (using late release) or the date number (if dateti...

11 years ago | 0

Answered
Strrep for multiple rows?
Case where cell strings win!!!! :) Given a variable character array of _ds_ for date(string), >> ds=['30-Nov-0000';'30-...

11 years ago | 0

Answered
index out of bounds because numel(xcorn)=1
You called it with a single valued array (vector) apparently with the argument _ncorn_ having a value greater than 1 (one). A...

11 years ago | 0

Answered
FFT in MatLab and Origin Pro comparison. Plots are the same but frequency data is a little bit different. Why?
First of all, you'll have to use the same number of points for both spectra, then the difference should simply be one of setting...

11 years ago | 0

Answered
weighted average w/ matlab
Have to decide how much you want the weights to be, but the general idea would be sotoo-- >> y=randi([100 150],40,1); % som...

11 years ago | 0

Answered
Text in plot that has x-axis in terms of datetime
A date number of the time x. Same idea as with ordinary axes; the date axes is one with the limits based on the first/last date...

11 years ago | 1

Answered
Calculating flow sessions from a water meter time series
OK, since this is a self-described learning exercise, hints first (treat it kinda' like homework with "show your work first") in...

11 years ago | 0

Answered
2 differenct size arrays, I want to make the shorter array the same size as the longer by adding Zeros between the indices or the missing numbers and make them the same length
No loops needed (or, in Matlab, wanted... :) ) >> O=[A(:,1) zeros(size(A,1),1)]; >> O(B(:,1),2)=B(:,2) O = 1 0 ...

11 years ago | 0

| accepted

Load more