Answered
Read time with colon from .txt file
>> s='12:25:25.17' >> fmt=[repmat('%d:',1,2) '%d.%d']; >> sscanf(s,fmt) ans = 12 25 25 17 >> Salt ...

13 years ago | 0

Answered
non zero rows per column
"Deadahead" solution... B=zeros(size(A))'; for i=1:size(A,2) ix=A(:,i)~=0; B(i,ix)=find(A(:,i)); end

13 years ago | 0

Answered
how to plot semilogy on two axes
As surmised above, you never set the x-axis limits on the second axes... ... H2=axes('position', get(H1,'position')); s...

13 years ago | 0

| accepted

Answered
How do I group loaded .txt files on a single array or struct?
That's because the names aren't the same; only the substring date_seqNo portion match-- >> G.name='GPS_01122013_1'; >> H.n...

13 years ago | 0

| accepted

Answered
while loop iteration in matlab?
A=[]; iter=0; while... iter=iter+1; A(i)=...; ... end NB that if _iter_ grows very large the reallo...

13 years ago | 1

Answered
If's and elses?
One of the most common difficulties in Matlab syntax for newbies -- *if* is _T_ iff *all(condition)* is _T_. So, if your x vect...

13 years ago | 0

Answered
min MAX of several variables
If same size, tmp=[zal1, zal2, zal3, agg1, zgg2, zgg3 ]; maxz=max(tmp(:)); minz=min(tmp(:)); Unfortunate can't use the...

13 years ago | 0

| accepted

Answered
Draw lines between points
Simply read in the array as it is in the file, then if m = 11 44 2 9 11 44 5 8 2 ...

13 years ago | 2

| accepted

Answered
Matlab rejects string with single quotation even after using strrep
The single quotes when displaying a variable indicate the content of a cell array _containing_ a character variable, not a chara...

13 years ago | 0

| accepted

Answered
line of code help!
for jj = 1:N ... y{jj,ii}(:,1:(ii-1)) = x{jj}(:,1:(ii-1)); y{jj,ii}(:,(ii+1):end) =...

13 years ago | 0

Answered
Textscan - how to handle blocks
Well, you neglected to point out that the dots that presumed indicated existing but unshown columns are actually in the file as ...

13 years ago | 0

| accepted

Answered
How can i change a Lat, Long and ellipsoid separation ascii file into a matrix?
S=zeros(size(D,1)+1); % initialize array S(1,2:end)=D(:,1)'; % first column D--> row 1 S(2:end,1)=D(:,2)...

13 years ago | 0

| accepted

Answered
How can i change a Lat, Long and ellipsoid separation ascii file into a matrix?
That's back to the problem as I first interpreted it -- if you have three columns of the same length, there's no way to full...

13 years ago | 0

Answered
Textscan - how to handle blocks
Read via *textscan* into cell array. Use _'collectoutput',1_ to aggregate into a cell containing the text and another the numer...

13 years ago | 0

Answered
bar graph grouped with custom x-axis
Sure, just set the _'xticklabel'_ property as desired. You may also want to set _'xtick'_ to an appropriate number of values....

13 years ago | 0

| accepted

Answered
How make coding for condition in MATLAB
a=(PA/Ps)^0.2856; if a>1, a=0.1; end It would seem that's a pretty big discontinuity to introduce, however, by the choic...

13 years ago | 0

| accepted

Answered
How to create an equally spaced 1D array?
Create a new x set of points however desired--a couple of possible choices would be N points between the first and last actual p...

13 years ago | 0

Answered
Problems when using textscan to read csv files
1) They're only 22 columns of data for a fmt string of 25...can't help altho by itself it doesn't seem to confuse. (ADDENDUM: B...

13 years ago | 0

| accepted

Answered
Open and read monthly dataseries with the filename 'yyyymmdd'
[y,m,d]=datevec(StartDate2); nmo=round(EndDate2-StartDate2)/12)+1; % num months approx between Dates=[StartDate2:d...

13 years ago | 0

Answered
Error using * (Inner matrix dimensions must agree)
doc times % or '.*' will answer all...

13 years ago | 1

| accepted

Answered
Ridge regression y=a1*x1+a2*x2+a3*x3+C
From help ridge "B1 = ridge(Y,X,K) returns ... regression coefficients... ... The results are computed after ...

13 years ago | 0

| accepted

Answered
find a values in matrix
val=2.3926; A=H(abs(H-val)<1.e-5); NB the "fuzzy" comparison to avoid FP precision problems

13 years ago | 0

Answered
How to divide a data arry into blocks like this using a FOR loop?
Quick thought... For the first case from command line it's easy enough >> N=16; d=rand(1,N); >> blkdiag(d(1:N/2),d(N/2+...

13 years ago | 0

Answered
Clipping property doesn't work?
Well, "correct" is in eyes of beholder...it is the behavior as implemented; whether the other plot types should inherit 'clippin...

13 years ago | 0

| accepted

Answered
Searching for Numbers above a certain Threshold
FindThreshold = str2double(FindNum) if FindThreshold > 30.7 If FindThreshold is a vector as will often be the case, th...

13 years ago | 0

Answered
Adding to plotyy / Datarepresentation using multiple representations of same data.
The problem is with *axes* as standalone and the plot order in plotyy. If you execute axes(TurnerPlot(2)) the RH axe...

13 years ago | 0

| accepted

Answered
Adding to plotyy / Datarepresentation using multiple representations of same data.
One solution x=Dataset(:,1); % more convenient x/y-axis datasets y=Dataset(:,5); % more convenient x/y...

13 years ago | 0

Answered
Rounding error for simple array
See <http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html> or the Matlab FAQ <http://matlab.wikia.com/wiki/FA...

13 years ago | 0

Load more