Answered
ERROR with type off data
try W(iter)=wmax-((wmax-wmin)/single(itmax))*iter

15 years ago | 0

Answered
Convert matrix to constant
Use the "From Workspce" block. Have your time vector and data vector arranged in two column format as below: [t1,d1; t2,d2...

15 years ago | 0

Answered
Function output in another function?
In test2.m function [out1,out2]=test2; out1=1; out2=2; In test.m function t=test(a) [out1,out2]=test2; ...

15 years ago | 0

Answered
Save Axis Labels/Titles/Ticks for Iterative Plotting
use hold on before the second plot. help hold use copyobj() Or maybe this is what you need. Note that changing the 'xdata','yd...

15 years ago | 0

Answered
generating report in pdf format
To create a .pdf file from a .doc file, install a PDF printer driver from Adobe or the free pdf995. Then in MATLAB, use a Word C...

15 years ago | 0

Answered
Need clarity of this command
You are right. f=[]; % make f an empty matrix a=1;b=2; f=[a;b] % doing vertical concatenation f=[a b] % doing...

15 years ago | 0

| accepted

Answered
Vectorization of loop with find
use hist() The example below shows how it can be used. The result is the same as a although it is in a slightly different forma...

15 years ago | 0

Answered
acting on multiple plots across multiple axes
The MATLAB complaint is probably caused by your your previous definition of mylocation and myplot. If you initialize them proper...

15 years ago | 1

| accepted

Answered
Referencing common set from two similar matrices
It sounds like you just need intersect() %% X=[(1:10)',rand(10,3)]; Y=[(5:15)',ones(11,5)]; [C,Ix,Iy]=intersect(X(:,1),...

15 years ago | 0

| accepted

Answered
Opening Preexisting Functions
edit gsvd.m Not all functions are provided with source code though.

15 years ago | 0

| accepted

Answered
Error in code generation for model with S-function
That is what you want, right? You build the S-function for your model, give it to your customer so they can use it for simulatio...

15 years ago | 0

Answered
specify lines
The number returned for h when you run h=line(x,y) is called handle. The number is unique and may not be the same when run run i...

15 years ago | 0

| accepted

Answered
Breaking out of input() ?
Once you opened MATLAB, Click menu Window->Command History. A window will show up showing all your previous entries in the Comma...

15 years ago | 0

Answered
How Can I Vectorize Function With If Statement?
>> a=1:10 a = 1 2 3 4 5 6 7 8 9 10 >> b=arrayfun(@myfunc,a) b = 1 1...

15 years ago | 5

| accepted

Answered
how to use uiopen
try a=uiimport

15 years ago | 0

| accepted

Answered
Change Excel Number Format From Matlab
eActivesheetRange.NumberFormat='0.00'

15 years ago | 0

| accepted

Answered
WHy do I get "ans = 1" in the Command Window?
Check all of the three functions solnpde, solnic and solnbc. There must be a line somewhere that doesn't have the ; at the end, ...

15 years ago | 1

Answered
correct my Postprocessing code
Check the help of fgets(). Maybe you want to try fgetl()?

15 years ago | 0

Answered
MATLAB web browser problem
Check your Preferences->Web, do you have a proxy server set up?

15 years ago | 0

Answered
calling multiple rows from a spreadsheet
a=1:144*30; b=a(1:144:end);

15 years ago | 0

Answered
Multiplication implementation help?
You need to initialize m=1 and then do m=m*(x(i)-x(j)), or m=prod([m,x(i)-x(j)]). Use a test vector of x to verify the result.

15 years ago | 1

| accepted

Answered
Isolate data elements out of a column on NaNs
a=[0 nan 1 nan]; b=a(~isnan(a))

15 years ago | 0

| accepted

Answered
importing numeric data from a text file with column headers, using column headers as vector names
If your text file has the consistent format as shown in the link, the importdata() should be enough. Then, maybe you can convert...

15 years ago | 0

Answered
how to convert a accelerometer data to displacements
There is really no solution for this problem except that you need to check the quality of your accelerometer signal data. Is it ...

15 years ago | 0

Answered
How to manage a list of variables with parameters?
use dataset() or structure %% Student=cell2struct(repmat({[]},3,1),{'Grades','Absense','Age'},1) StudentProperty=fiel...

15 years ago | 1

Answered
how to use input element of function in code?
Inside your function, just use y=x(1)+x(2). It is a good idea to check the size of x first.

15 years ago | 0

| accepted

Answered
Create a surface plot with colors associated to value on cell
use pcolor() Two notes. The last row and last column is not shown so you might want to pad NaNs. Second, pay attention to the i...

15 years ago | 0

Answered
Matlab Legend
%% plot(magic(10),'b'); Name=strcat('L',cellstr(num2str((1:10)'))); hold on; plot(magic(3),'r'); h=legend([...

15 years ago | 0

| accepted

Answered
Plotting the equation of a plane
patch([x1,x2,x3],[y1,y2,y3],[z1,z2,z3],'green'); view(3);

15 years ago | 0

Load more