Answered
How can I avoid infinite while loop?
Well, since ((N*2)+(N+1))/N = (2*N+N+1)/N = (3*N+1)/N n=3+1/N and the expression approaches 3+ as a limit, never ap...

12 years ago | 1

| accepted

Answered
Cannot get Q1, Q2, ..., Qn equations
Once again, "don't do that!!!" See the FAQ on "the Matlab way" to avoid it. <http://matlab.wikia.com/wiki/FAQ#Why_is_it_advi...

12 years ago | 0

Answered
subplots destroys the axis properties
Per the doc, if you overwrite the area of a subplot, it deletes the existing one and creates a new one. AFAIK there's no way to...

12 years ago | 1

| accepted

Answered
convert narr model data time to datevec or datestr
>> dn1800=datenum(1800,1,1) % baseline point in Matlab datenum dn1800 = 657438 >> datestr(dn1800+1744392/24) % ad...

12 years ago | 3

| accepted

Answered
For Loop Not Working??
I seriously recast your code below...I _may_ have ended up w/ a mismatched parens or two as I tried to remove many of the superf...

12 years ago | 1

Answered
How to plot serial data against time
In real time or just 2-second intervals? If the former see doc now doc datetick doc datenum If just incremental s...

12 years ago | 2

| accepted

Answered
how to slect random element from excel sheet?
X1=xlsread('constant_file.xlsx',1, 'A(i)') In the above, 'A(i)' is the literal string 'A(i)', _not_ some random cell refer...

12 years ago | 1

| accepted

Answered
Subscripted assignment dimension mismatch
xcur=(B*cur)+c; p3(k2,:)=xcur'; _xcur.'_ must be a column vector of the same length as that the first time on each s...

12 years ago | 1

Answered
How do you evaluate a revenue function over a range of price and quanity inputs?
Factoring out the common variable of qm30, it would seem your functional is-- netcfq = qm_30*(nri*(price+pricediff) - price...

12 years ago | 1

Answered
IS THERE ANY TOOLBOX FOR K MEANS CLUSTERING IN MATLAB?
>> which kmeans C:\ML_R2012b\toolbox\stats\stats\kmeans.m >> 'stats' is the Statistics Toolbox. Contact TMW sales for f...

12 years ago | 1

Answered
Add trendline and calculate slope of trendline
For a zero-intercept model, simplest is just use the "backslash" function... m=X\Y; % estimate slope w/ zero intercept ...

12 years ago | 1

Answered
For Loop Not Working??
_...I put an end if statement at the end which seems to have solved it..._ Solved what??? for TSR=4:10 % TSR from 4 to 1...

12 years ago | 2

Answered
For Loop Not Working??
Your code snippet is incomplete; you have no _i_ defined as shown what more as _"a counting index of 1"_ . The for index vari...

12 years ago | 2

Answered
Number of elements must be the same??
_store_Phi(i)_ is a single value in the array and your result _Phi_ is an array of some dimension. If this is intended, then yo...

12 years ago | 2

Answered
How to skip header consit of integer words
fid=fopen('file','r','ieee-be'); fseek(fid,8*4); temp=fread(fid,[360,180],'real*4','ieee-be').'; % no skip and fix size...

12 years ago | 1

| accepted

Answered
Subtract one element from the following inside a loop
for i=2 while pres(i) < pres(i-1); presdiff = pres(i+1) - pres(i); end i=i+1; end is identicall...

12 years ago | 1

Answered
Multiple Linear Regression Trouble
I think on reflection the comment I made earlier about Matlab building the _X.'*X_ matrix actually is your problem. I just happ...

12 years ago | 1

Answered
plotyy with bar graphs
*plotyy* is somewhat limited in that it can only take the two sets of x,y data so you have two choices -- a) make custom func...

12 years ago | 0

Answered
solve a non-linear least squares problem
With your constraints as they are, the cuic term dominates -- a single quadratic would appear to likely fit the data quite nicel...

12 years ago | 2

Answered
How do I import a timestamp from an ASCII File?
I don't use *importdata*; I'd recommend just reading the data files. Then convert the datestrings to internal *datenum*s and th...

12 years ago | 0

| accepted

Answered
How to label individual data points in a 3D plot?
doc text

12 years ago | 1

Answered
replace numeric char within a column
x(x(:,colID)==-999,colID)=0; for your specific column in colID

12 years ago | 0

Answered
Why does MATLAB 2014a get stuck in the splash screen? (Unix)
Contact TMW directly @ <mathworks.com> for installation/startup issues, even if Student License.

12 years ago | 0

Answered
What's wrong with my code?
_...the code doesn't display the x-column_ Bad syntax in disp (' Gause-Jordan Elemination method: '); R x' Matlab can...

12 years ago | 1

| accepted

Answered
open so many files with name of time series in order
Try sotoo (caution, aircode, not tested)... d=dir('xmrg??????????z.*'); % return the list of all dd=strvcat(d(:).name);...

12 years ago | 0

Answered
Save data from cell array to data file
It appears your data are complex in the .mat file? If so, the simplest is to use them directly. Unfortunately, C (and hence Ma...

12 years ago | 1

Answered
How to plot graph with three axsis (an example figure is included )
_...not sure what is the mistake I am doing. As you can see in the figure that the legend does not reflect the curves colors._ ...

12 years ago | 1

Answered
Read and convert a .dat file containing binary data
EVENT=│Event│Event│Event│....│Event│; Event=(unsigned 64 bits int)Time Tag│(unsigned 16 bit)Energy In Matlab to read a fi...

12 years ago | 1

| accepted

Answered
Determine number of bytes per element under program control
No *sizeof* directly that I know of, no. Wouldn't be hard to build one from *isa*, however. An outline would be something ot...

12 years ago | 1

Answered
How to "filter" a matrix using a vector quantity?
Almost there... N=y(x,:); the _x_ vector is the row index, _:_ picks up all the columns. doc colon for the detai...

12 years ago | 0

| accepted

Load more