Answered
How to multiply the column in matlab..?
Just use the *:* operator in the row position to collect all rows and a specific column number in the column position. NB: also...

11 years ago | 0

| accepted

Answered
how to put vectors with different size in one matrix and how to suppress the NAN in this matrix
Matlab can only treat "ragged" arrays as a cell array. Use the "curlies" ( *{}* ) to place an array in a cell array location. ...

11 years ago | 0

Answered
Is there a compact way to check multiple variables against the same conditions?
If _x_, _y_, _z_ are logical, then you can write the logical expression as above; if they're numeric and can hold anything but 0...

11 years ago | 0

| accepted

Answered
How to extract only part of a file name
Presuming the numeric substring isn't the same length always, ix=strfind(s,'_'); % get the underscore locations t=s(1:i...

11 years ago | 2

| accepted

Answered
How can I separate my data set easily based on station names
This is the place to use a table and categorical arrays. Start at <http://www.mathworks.com/help/releases/R2015a/matlab/tab...

11 years ago | 0

Answered
[DISCONTINUED] New design of the forum - grey on white / wish list #3 / bug reports
When a response is edited the link to that answer or comment is broken.

11 years ago | 0

Answered
[DISCONTINUED] New design of the forum - grey on white / wish list #3 / bug reports
The basic problem is still twofold -- a) The refusal to use a newsreader format with threaded entries as any reasonable seria...

11 years ago | 1

Answered
Plotting Sin Curve with limitations
As written your two sine terms have an amplitude of unity and an offset. Consequently, your plot is going to be basically three...

11 years ago | 0

Answered
How do I load ASCII dat file to MATLAB
fid=fopen('newtext.dat'); fmt=[repmat('%f',1,7) '.....']; % include the junk as pattern matching C=cell2mat(textscan(fi...

11 years ago | 0

| accepted

Answered
how do i compare two matrices with different sizes.so that i get to know when elements of smaller matrix are exactly matched to elements in larger matrix?
"Dead ahead" solution -- it's undoubtedly doable via *conv2* or the like and there may be something in the Image Processing Tool...

11 years ago | 1

| accepted

Answered
Read txt file into a matrix
>> type hans.txt Sample Time Encoder 2 Pos [ 0 0.000 0; 1 0.009 0; ...

11 years ago | 0

Answered
Change Tick Mark Enumeration for Plots
Sure, just set what you want...as a note going forward, most often with these kinds of things, "just try it" is the fastest way ...

11 years ago | 0

| accepted

Answered
how do i compare two matrices with different sizes.so that i get to know when elements of smaller matrix are exactly matched to elements in larger matrix?
doc ismember % maybe? NB: if are floating point values you'll probably need to use an inexact comparison to ensure "close ...

11 years ago | 0

Answered
plot in different colors for fit function
hL1=plot(f,mid_bin',corr_perct'); hold on f = fit(mid_bin_Kendall', corr_perct_Kendall', 'smoothingspline'); hL2=plot...

11 years ago | 5

| accepted

Answered
Get current axes from multiple figures.
I don't use Simulink (in fact never even seen an installation), but I think the answer is to save the handle to the axes created...

11 years ago | 0

Answered
How can I make a script perform calculations across multiple columns?
Read the spreadsheet into an array (I'll call it _x_ for simplicity)... x=xlsread(... ang=bsxfun(@atan2,x(:,3:2:end),x(:...

11 years ago | 0

| accepted

Answered
Creating a new matrix by interpolating two other matrices
The beauty of Matlab is that it is vectorized to operate over arrays so you really don't have to do anything special. _BUT_, yo...

11 years ago | 1

| accepted

Answered
Reading and Writing some parts of a line in another text file in a preferred format in Matlab
_"... I need NR separated files which names are from 1 to NR..."_ See the FAQ at <http://matlab.wikia.com/wiki/FAQ#How_can_I_...

11 years ago | 0

| accepted

Answered
Improve regression to reduce RMSE
Only by improving either one or both of # the model (incorporating other terms or the like), or # the data itself to be more...

11 years ago | 0

| accepted

Answered
Problem with graphing different plots on the same graph within a ‘for’ loop.
For each group over the ranges, scatter(x,y) % where x,y are over the ranges, of course if loopIndex==1, hold on, ...

11 years ago | 0

| accepted

Answered
How can I redirect a script to take user input from a file instead of the keyboard?
Modify the script to read a file instead; I don't think you _can_ use command line redirection w/ Matlab (outside a compiled .ex...

11 years ago | 0

Answered
How can I sort this cell Array?
>> [~,ix]=sort(cell2mat(ca{1,3})); >> ca{1,2}=ca{1,2}(ix,:); >> ca{1,2} ans = 5 1 1 1 5 7 5...

11 years ago | 0

Answered
problem with 2nd axis Yticks with plotyy and semilogy
Don't have your data to play with specifically, but a dummy set >> y1=logspace(-1,-15,10).*rand(1,10); >> y2=logspace(-2...

11 years ago | 0

| accepted

Answered
How do I get matlab to create a new cell array of varying length with every iteration of a for loop?
_" a new cell array with every iteration,..."_ Don't do that!!! Having the arrays as elements in the cell array instead or u...

11 years ago | 0

| accepted

Answered
taking 2 columns from two different matrices and making a new 2 column matrix
Write it in one step... c=[b(:,1) a(:,2)]; _"... every bit of info on this topic just shows when there are small sample ...

11 years ago | 1

Answered
Save data to text file. Two vectors, a konstant and a text
You can't concatenate the numeric and string values in the argument list via [] nor the varying size of the first output line an...

11 years ago | 1

Answered
how to delete any variable from outside the for loop
The warning _"htext size will be change every iteration"_ is from having not preallocated the array so it "grows" automagically ...

11 years ago | 0

Answered
how to draw line from first element of cell array to same cell array but fliplr first element and soon
>> CHM={[];[];17;[];[6 11];[1 9]}; >> for i=1:length(CHM) if ~isempty(CHM{i}) % NB "the curlies" {} in the address...

11 years ago | 0

Load more