Answered
How do I create an arbitrary polynomial with defined coefficient in vector form?
One way is b= [2 5].'; x=1; y=polyval(b,x);

11 years ago | 1

Answered
Change font size for second y-axis in plotyy
[X|Y] labels inherit font size, name, etc., from the axes. To change the ylabel fontsize independently of the axes tick label s...

11 years ago | 0

Answered
Finding the area between a graph and a line
for c=1:9 ix=Velocity_milesph(:,c)>=1000; int=(trapz(Time_h(ix),Velocity_milesph(:,c(ix)))); disp(int) end ...

11 years ago | 1

| accepted

Answered
Hello, I have question which i need to solve. if i got a matrix, how can i check if there is any equal rows in it ? without using loops,if,unique,for :\ thanks
Well, there is a way w/o *unique*; I presumed the prohibition against *unique* originally wasn't really so; only to avoid a loop...

11 years ago | 0

Answered
Hello, I have question which i need to solve. if i got a matrix, how can i check if there is any equal rows in it ? without using loops,if,unique,for :\ thanks
function isMult=ismultirow(x) % return logical T if are identical multiple rows in input X array isMult=size(unique(...

11 years ago | 0

Answered
'Not equal too' statement not working
As noted in the above comment prior to seeing your response... >> x=[5,3]; y=[5,2]; >> all(x==y) ans = 0 >> y(2)=3;...

11 years ago | 0

Answered
Only month and year matrix
Use the facility of *datenum* to automagically roll over the higher-granularity fields... dn=datenum(1946,[1:((2003-1946)+1...

11 years ago | 0

Answered
How to determine start and end points of fitting curve?
A power model doesn't fit these data worth a hooey at the lower end...try plot(f,x,y,'*') set(gca,'yscale','log') yli...

11 years ago | 0

Answered
How do I store matrix solutions from a loop into another matrix?
_T_ has to be size of _Tr_ in each plane; not sure where you got the 6,1 from... T=zeros(4,4,6); for n=1:6 T(:,:,n)...

11 years ago | 0

| accepted

Answered
plotting using semilogy in a loop
See doc hold Set hold on after the first iteration and add the subsequent lines. You'll want to cycle the colo...

11 years ago | 0

Answered
Create a Matrix with a specific main diagonal
Multiple ways possible; one-- >> N=5; % diagonal value >> sz=3; % size >> m=ones(sz)+diag(repmat(N-1,1,sz)) m = ...

11 years ago | 0

Answered
How can I use unique on two separate matrices?
>> N=hist3([A(:,1) B],c) N = 1 1 0 1 0 0 >> Have to iterate over each column

11 years ago | 0

Answered
deleting and adapting columns in matrix of function handles
There are no "columns" in _A_ and _A_ is not a matrix... >> A = @(x) [x , x^2, x^3; 2*x, 2*x^2, 2*x^3] A = @(x)[x,x^...

11 years ago | 0

Answered
interp1 "The values of X should be distinct."
Hmmm....mayhaps TMW has changed the error message slightly? Generally one has a doubled-value in the interpolating function -- ...

11 years ago | 0

Answered
how to get the sum of the difference of the output from a multiplication and a data set
OK, with the revised objective, no loop needed... b=2; c=1; d=1; n=4; M=[4.5 10.5 20.5 25.6 30.8]; f=[1 4...

11 years ago | 0

| accepted

Answered
How to separate Vector in different Lenghts
Well, unless you fix the value of _Value_ it's going to be a variable-length vector by definition. I don't know where the uC is...

11 years ago | 0

| accepted

Answered
How to plot stacked bar in Matlab with showing each limit ?
>> Y = [5 1 2; 8 3 7; 9 6 8; 5 5 5; 4 2 3]; % sample data from bar example... >> Z=cumsum(Y,2); ...

11 years ago | 0

| accepted

Answered
how to skip a executable file?
Start the external program with the trailing _&_ to allow execution to continue immediately and then issue a *pause* for the des...

11 years ago | 0

Answered
Trying to get a plot but I get the error below, any way to plot without changing the code but using different syntax?
xHe=0:1:100; %Important xAr=100:-1:0; %Important pg=(1.5979.*xAr)+(.1624.*xHe); ... yprime(2,1)=(V.*(pm-pg).*g-(...

11 years ago | 0

| accepted

Answered
How to limit a string?
Test for the existence of the complete string and exclude...set those lines in the initial array =[] before processing the rest....

11 years ago | 0

| accepted

Answered
How do I generate a vector of ordered integer without a loop or in faster way
Prealllocate and populate instead of concatenating for starters... M=zeros(1,1+sum(q)); i1=2; for q=3:2:9 i2=i1-...

11 years ago | 0

Answered
How to use logical indexing to change certain values in matrix
x(x==112)=225;

11 years ago | 4

Answered
Converting unformatted text to formatted text
>> fmt='%*s%f%f%f'; >> fid=fopen('test4.txt'); >> c=cell2mat(textscan(fid,fmt,'headerlines',3,'delimiter','[]:','collect...

11 years ago | 0

Answered
Reading unformatted text and converting to formatted
RFCH[0][0]:1, RFCH[0][1]:2, RFCH[0][2]:3, fmt='RFCH[%d][%d]:%d'; fid=fopen('yorfile'); c=cell2mat(textscan(fid,fmt,...

11 years ago | 1

Answered
Saving responses to a matrix
What variable type is the response; numeric or character? If it's numeric you can simply write mat=[mat;[sim res]]; a...

11 years ago | 0

Answered
How to plot XYZ data, so that the Z-components are plotted as large 'pixel' and have a color corresponding to their value.
Try scatter(x,y,25,z,'filled') Salt to suit on colormap, marker size, etc., etc., etc., ...

11 years ago | 1

Answered
Which is the best method to find zero ? and choose the max value and plot a graph comproving the zeros.
>> fsolve(f1,sqrt(2)) Equation solved. fsolve completed because the vector of function values is near zero as...

11 years ago | 0

Answered
Repeat elements in a 2D vector
I'm no image processing guru, but look at doc filter2 Mayhaps there a specific equivalent for image reconstruction in th...

11 years ago | 0

Answered
Import Data from Text file
For that file you'll probably just as well off to process it line by line, parsing each line as needed... fid=fopen('yourfi...

11 years ago | 0

Answered
How to import rows from a tab seperated .txt file containing a specific string?
80k lines with current memory available isn't all that big a file...simplest is to just read the whole file into memory, delete ...

11 years ago | 0

Load more