Answered
fill part of vector
There's nothing left so there's no point in doing anything except sotoo-- a=0; a(1:length(b))=b; a=[b zeros(1,length(a...

12 years ago | 0

| accepted

Answered
how to take out specific month from data
2100 is _NOT_ a leap year; it's the "divided by 100" exception of the "divisible by four" rule. Then there's the 400 yr correct...

12 years ago | 0

Answered
i cannot open a file from external hard disk
Didn't enclose the path in quotes so Matlab's trying to interpret it. addpath(genpath(['H:\D\codes\scene understanding\code...

12 years ago | 2

| accepted

Answered
Conditional case on strfind
Not easily by character matching/searching. You'd need to convert the numeric value strings in the and then do the search on th...

12 years ago | 1

Answered
how can I correct errors by interpolation?
>> a=[2 1 720 2.3 2.6 -40 -2 7 3]; >> ix=find(~iswithin(a,0,4)) >> i1=iswithin(a,0,4); >> interp1(find(i1),a(i1),ix) ...

12 years ago | 0

Answered
Finding a cell in an array
One way...should be a simpler one but it didn't come to me otomh just now... _c_ is a cell array around had for an earlier qu...

12 years ago | 1

Answered
How can I create a bigger matrix/array, having 200 zeros matrices in it?
Presuming you fix the number of bins for each, just h=zeros(200,nBins); % should do it If you're going to use different...

12 years ago | 0

Answered
How to truncate text in an array
As c{1,2}(1:desiredlength) Look up _Multilevel Indexing to Access Parts of Cells_ in the doc under _Cell Arrays_ in the ...

12 years ago | 0

| accepted

Answered
How to averaged a daily time series to a time series of 10 day epochs
nr=size(x,1); % #columns in data array nA=10; % average over this many m=reshape(mean(reshape(x,nA,[]...

12 years ago | 1

Answered
Can REGEXP be utilized in searching M x N matrix values?
Surely it could be made to work, but is way overkill for the job... >> c=textread('brad.txt','%f',81,'headerlines',6); >> ...

12 years ago | 0

Answered
Replace X and Y labels
Save the handle of the label when you write it and then adjust the _position_ and probably the _horizontalalignment_ properties....

12 years ago | 0

| accepted

Answered
Importing batches of data files
Sure, just iterate thru a directory listing... d=dir(*.*); % use appropriate wildcards to filter if needs be... for i=...

12 years ago | 0

Answered
plotting matrix with the command plot and meshgrid. Please clarify that to me.
No, your first example is not right -- per the documentation for *plot*, the columns of Y when no X is given are individual line...

12 years ago | 1

| accepted

Answered
What's wrong with Plotyy?
Is this what you're looking for, roughly? X=[120 120;112 112];Y= [1.5 -2;3 2]; % set up the point vectors [AX,H1,H2] =...

12 years ago | 0

Answered
randomly sampling with replacement from a sample.
_...sampling with replacement 1000 trucks from the 113,000 in the data..._ y=truckdata(randi(113000,1000,1));

12 years ago | 0

| accepted

Answered
Interpolating data in a better way?
Yeah, try *interp2* -- sotoo [nr,nc]=size(rawdata); [X,Y] = meshgrid(1:nr,1:nc); % the original array mesh [Xq,Yq] ...

12 years ago | 2

| accepted

Answered
fprintf has been giving blank files
Again, you're not paying attention (at least _close_ attention) to the doc's... Two problems-- 1) Didn't save the file han...

12 years ago | 2

Answered
How to generate sequence integers between two ranges?
a=[a(1) floor(a(1))+1:floor(a(end)) a(end)];

12 years ago | 3

| accepted

Answered
how to change the scale on the y-axis to a double log sclae?
You'll have to do it manually by transforming the data and the y axis values then set the tick mark values at the appropriate ti...

12 years ago | 0

Answered
Explain why it makes sense that matrix A( :, :, 1) is two-dimensions, while A( :, 1, :) and A(1, :, :) return three dimensions
Easiest is probably just to look at what you get... >> a=rand(3,3,3) a(:,:,1) = 0.0811 0.4868 0.3063 0.929...

12 years ago | 0

Answered
How can I align text to be left-justified using fprintf?
>> fprintf('%10s\n','abcdef') abcdef >> fprintf('%-10s\n','abcdef') abcdef >> doc fprintf read up on form...

12 years ago | 5

Answered
how to apply hamming window to sinal
... Vam = (Ac+Vm).*sin(2*pi*fc*t); % amplitude modulated signal VamWindowed=Vam.*hamming(length(t),'periodic'); do...

12 years ago | 0

Answered
Matlab Function to Compute Matrix Operations
In Matlab the RHS is just N.*(E+a*N) where size(N)=[3,1] size(a)=[3,3] That's taking the shortcut of not expa...

12 years ago | 0

| accepted

Answered
Using loops and strcmp. Have 1 master char array, need to find matches of each entry in 2 other arrays.
>> mtch=[cellfun(@(x) sum(ismember(C2,x)),C1) ... cellfun(@(x) sum(ismember(C3,x)),C1)]; >> mtch=[mtch sum(mtch,2...

12 years ago | 0

Answered
Why am I getting error: subscript indices must either be real positive integers or logicals? (Boundary Value Problem)
a=0; b=8; x=linspace(a,b); ... Ergo, q(x)=1+0.01*9*x.*(8-x); Is going to be q(0)=1+0.01*9*x.*(8-x); a...

12 years ago | 0

Answered
dlmwrite help - including column and row numbers in output
One way.... [i,j]=ind2sub(size(A),1:numel(A)); % the index vectors B=A.'; % row major orde...

12 years ago | 0

| accepted

Answered
Using loops and strcmp. Have 1 master char array, need to find matches of each entry in 2 other arrays.
Oh, that's pretty simple, then... >> for i=1:size(Var1,1) disp([sum(ismember(Var2,Var1(i,:),'rows')) ... ...

12 years ago | 0

| accepted

Answered
how to construct the 10x100 matrix of same values in each column
doc repmat

12 years ago | 1

| accepted

Answered
How to plot this graph?
Either create multiple x-axes at the right positions without the associated y-axes displayed or, perhaps easier, add an offset o...

12 years ago | 0

Answered
element wise sum in array
Good spot for function handle... >> f=@(t,x,c) 0.6.*t.*x.^3./c.^4 f = @(t,x,c)0.6.*t.*x.^3./c.^4 >> f(t(p),x(p),c(p...

12 years ago | 0

Load more