Answered
How to write the equivalent of an 'until loop' in matlab?
<http://www.mathworks.com/help/matlab/ref/while.html while loop>

10 years ago | 0

Answered
How can i draw this type of graph?
x=[0 0.2 0.4 0.6 0.8 1] y=[0 0.02 0.04 0.06 0.08 0.1] cl='rgbkcmy' for k=2:numel(x) line([0 x(k) x(k) 0],[0 0 y(k) y(...

10 years ago | 0

Answered
Change x-axis.
Use xlim and ylim

10 years ago | 0

Answered
import data from file into an array
A=importdata('yourfile') or A=dlmread('yourfile')

10 years ago | 0

Answered
Use variable in two different functions
[var1,...]=fcn1(...) get the variable var1 from fcn1 and use it in fcn2 [...]=fcn2(var1,...)

10 years ago | 0

| accepted

Answered
How to Compare value returned by regexp and another string ?
nameF='aa.txt'; cni =regexp (nameF, '.txt', 'split') The result is cni = 'aa' '' then strcmp(cni...

10 years ago | 0

Answered
delete or keep special rows in a cell array based on specific column values
A={'summits,' '-1' '.' ' 3' 'greenhouse' ' 0' 'hello world' '-2' 'abandoned' '-2'} d=cellfun(@(x) regexprep(x,'[,...

10 years ago | 1

| accepted

Answered
Read many column from excel sheet
If you want all columns A = xlsread(filename);

10 years ago | 0

Answered
how to merge tow matrix ?
C=A|B

10 years ago | 0

| accepted

Answered
How to generate a "special" signal in Simulink
<</matlabcentral/answers/uploaded_files/49036/answer6.jpg>> In this example, the period is 10.

10 years ago | 0

| accepted

Answered
Extract upper diagonal half in a large cell array and replace rest with NaN
A=[1 2 3 4; 5 6 7 8; 9 10 11 12;13 14 15 16] ii=ones(size(A)) idx=rot90(tril(rot90(ii)),-1); A(~idx)=nan

10 years ago | 3

| accepted

Answered
Matlab AND operation concerning intervals
t = -1: 0.01: 4; s=zeros(size(t)) idx=t>=0 & t<=3; s(idx)=(-2/3)*t(idx) + 2; plot(t,s)

10 years ago | 1

Answered
surface plot with a matrix
<http://www.mathworks.com/matlabcentral/answers/123643#answer_131349>

10 years ago | 0

Answered
How to create a matrix?
n=4 % in your case use n=101 out=tril(2*ones(n),-1)

10 years ago | 2

| accepted

Answered
how can plot complex data in matlab?
alpha=-pi:0.01:pi k=.5 x=k*cos(alpha); y=k*sin(alpha); fill(x,y,'r')

10 years ago | 0

Answered
how to dislay red color of an image
A(:,:,2:3)=0 imshow(A)

10 years ago | 0

Answered
Plot two graphs in one scope
export your two signals to workspace, then plot them in one figure

10 years ago | 0

Answered
How does fmincon work?
Benho, have you read the documentation? There are many examples there: <http://www.mathworks.com/help/optim/ug/fmincon.html>

10 years ago | 0

Answered
How do I multiply vector elements in the following fashion???
A=[18 44 20 55] B=[4 6] out=reshape(bsxfun(@times,A',B),1,[])

10 years ago | 0

| accepted

Answered
why not this code run?
Your code should be something like this N=10; n=0:N-1; h=[0 0 0 1 -2.7083 4.1861 -3.0451 0.73071 0 ]; x=[01.9021 -1.1756...

10 years ago | 0

Answered
How do I find the sum of values in my cell array?
A={[1 2], [1 2 3 4 5],[0 8 7 6]} out=cellfun(@sum,A)

10 years ago | 0

| accepted

Answered
Error in converting Decimals from Degree Minutes Seconds
v=[33 31.15 0] % 31.15 is not allowed by Matlab, it should be an integer out=dms2degrees(fix([33 33.15 0]))

10 years ago | 1

| accepted

Answered
Elementwise subtraction .- does not work
bsxfun(@minus,[1 3; 4 5],[2 3])

10 years ago | 1

| accepted

Answered
How do I write an if statement within a function that tells the user there is an error if the input is not one of the 5 string variables accepted?
You can use ismember function s={'R' 'P' 'S' 'L' 'K'} a='K' ismember(a,s)

10 years ago | 0

Answered
function to solve a binary matrix?
A =[0 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 0 1 0 1 1 1...

10 years ago | 0

| accepted

Answered
command for delaying matlab to execute a certain line
Matlab execute the lines of your code one after another. The if statement will be executed after the calculation of s(i). What i...

10 years ago | 0

Answered
find 2 element in a 2x(number) matrix
A= [ 1,0 ; 5,1 ; 0,2 ; 5,5 ; 0,0 ; 12,-5] b=[0 0] idx=find(all(ismember(A,[0 0]),2)) %or idx=find(ismember(A,b,'rows'...

10 years ago | 0

| accepted

Answered
Why continuous and discrete transfer function have different results
You are not expecting to get to get the same result from the two transfer function, the sample time will cause some difference, ...

10 years ago | 0

Answered
I having trouble with the for loop for the equation y=x^4-4x^3-6x^2+15. I need the x values to be -3 to 6
y =@(x) x^4 - 4*x^3 - 6*x^2 + 15 fplot(y,[-3 6])

10 years ago | 0

Answered
Change pzplot marker size
h=tf(1,[1 1 5]) pzplot(h) findobj(gca,'type','line') set(a(2),'markersize',7) set(a(3),'markersize',7)

10 years ago | 2

| accepted

Load more