Answered
Drawing lines in a loop
%Example close x=0:0.1:10 y=sin(x)./(x+0.1) plot(x,y) hold on x_line=[0 2 4 6 8 10] % The x coordinate intersecting th...

13 years ago | 0

| accepted

Answered
Problem 7. Column Removal
There is no error in your code. What is the expected result? If you want to remove a column number n A=magic(5) % Examp...

13 years ago | 0

Answered
Repeat vectors within a matrix multiple times
n=3 out=reshape(repmat(x',n,1),size(x,2),[])'

13 years ago | 0

Answered
Where is the short-cut in Matlab 2013a to comment?
I 'am not sure if that's what you are asking for, If you want to make multiple lines as comment, select those line then click on...

13 years ago | 2

Answered
Converting an image from Spherical coordinate system to cartesian coordinate systems
Use sph2cart function [X,Y,Z] = sph2cart(TH,PHI,R)

13 years ago | 0

Answered
Error while using rgb2gray
Maybe your image is not RGB, check size(X)

13 years ago | 2

Answered
Arrays of the same size are interpreted to have different size.
You should use Static_Object_Field( Mask==0)=Obseved_Object_Field(Mask==0);

13 years ago | 0

| accepted

Answered
Matching only parts of two cell arrays
out=find(cellfun(@(x) strcmp(x(1:6),B),A))

13 years ago | 0

| accepted

Answered
How to input a stream of matrix elements from Matlab into a simulink model?
If you mean by one element at a time: at t=0, s=A(1,1,1), at t=ts, s=A(2,1,1) at t=2*ts, s=A(1,2,1) and so on ...

13 years ago | 1

| accepted

Answered
Any other ways to program tan(x) between [-3*pi/2 to 3*pi/2])?
x=-3*pi/2+0.01:0.01:-(pi/2)-0.01 y=tan(x) y=[y nan y nan y] x=linspace(x(1),pi/2-0.01,numel(y)) plot(x,y)

13 years ago | 1

Answered
Multiply Matrix with column of different sizes
%Example A1=rand(240,1) A2=rand(300,1) %----The code-------- n=240; out=A2; out(1:n)=A1.*A2(1:n)

13 years ago | 0

Answered
how can I connect 2 matlab fcn blocks to each other
Use <http://www.mathworks.com/help/simulink/examples/if-then-else-blocks.html If-Then-Else block>

13 years ago | 0

| accepted

Answered
setup axis using plotyy
[AX,H1,H2] = plotyy(x1,y1,x2,y2) set(AX(1),'xlim',[xmin1 xmax1],'ylim',[ymin1 ymax1]) use set(AX(2),... ) for the se...

13 years ago | 0

| accepted

Answered
"Index exceeds matrix dimensions." error
Check in your code: *text* was used as a variable It's in the line [num,text,all] = ... replace it by [num,text...

13 years ago | 1

| accepted

Answered
making a exe.file in matlab
<http://www.mathworks.com/videos/getting-started-with-matlab-compiler-68744.html Matlab compiler>

13 years ago | 0

Answered
How to compile Simulink models before doing simulation?
To improve your simulation look at this link <http://www.mathworks.com/company/newsletters/articles/improving-simulation-per...

13 years ago | 0

Answered
whats the command to find quotient in MATLAB 2008b ?
q=fix(20/6) r=mod(20,6)

13 years ago | 3

Answered
Rearranging Elements in a Matrix Help
Use a sort function and reshape function

13 years ago | 0

| accepted

Answered
regular expression to replace ~ in code
str='one ~ two ~= three ~' pattern='~(?!\S)' regexprep(str,pattern,'dummy')

13 years ago | 0

Answered
Need to line up two graphs on same plot
Maybe your data contains Nan values?

13 years ago | 0

| accepted

Answered
Remove close value for matrix
A = [ 1 1 1; 1 1 1.5; 1.1 1.2 1 ;2 3 4;2.1 2.9 4.5] tol=0.5*ones(1,size(A,2)); v=(1:size(A,1)); idx=arrayfun(@(x) all(bsxfu...

13 years ago | 0

| accepted

Answered
Update an .m file variable from Simulink.
You can use interpreted matlab function block or matlab function block

13 years ago | 1

Answered
Continuous input from Workspace to Simulink model
You can use interpreted matlab function block or matlab function block

13 years ago | 1

Answered
How do I find the maximum peak from an interval?
max(y)

13 years ago | 1

Answered
Recursive vector operation without for loops
Your equation can be written as: %x(i)-x(i-1)-x(i-2)=u(i) with u(i)=0 D=[1 -1 -1]; N=1 y=filter(N,D,zeros(1,10),[0 1]) ...

13 years ago | 1

| accepted

Answered
How to find multiple duplicates in an array
n = {'a' 'b' 'c' 'd' 'e' 'a' 'a' 'e' 'c' 'd' 'a'} t = [10.01 2.1 5.01 6.07 9.3 10.02 10.0 9 5.05 6.1 10.001 ] k=unique(n) o...

13 years ago | 0

Answered
How can I use commands such as "roots" in simulink matlab function coding space?
You can use interpreted Matlab function block

13 years ago | 0

Answered
How to delete the row from cell array?
row=2 A(row,:)=[]

13 years ago | 9

Answered
How to fix the error: data must contain only individual strings or scalar values?
A=[[out1; qc1] teststat pval]

13 years ago | 0

Answered
using regexp for char data
a=cellfun(@(x) regexp(x,'\d+','match'),out1,'un',0); for k=1:numel(a) out(k,1)=str2num(char(a{k}(1))) end

13 years ago | 0

Load more