Answered
How to split a column in a table into two columns?
name_num={'ABC_123','EFG_456','GGGG','HHHHH'} s1=regexp(name_num,'[^\d_]+','match') s2=regexp(name_num,'\d+','match') s2(ce...

10 years ago | 0

| accepted

Answered
what is the meaning of for A(1,1:8) where A is a matrix
read the documentation <http://www.mathworks.com/help/matlab/learn_matlab/array-indexing.html>

10 years ago | 3

Answered
three figures in one figure for display
Use hold on

10 years ago | 0

Answered
Find a certain cell in a cell array?
I={ [1,2] [2,3] [4,5] ; [6,6] [0.8,8] [2,3] ; [1.1,4] [1,1] [2,2] } [ii,jj]=find(cellfun(@(x) isequal(x,[0.8,8]),I...

10 years ago | 0

| accepted

Answered
how can i open this file (matlab simulink)
Rename your file by removing the space, for example rename it as fullwave_controlled

10 years ago | 0

Answered
How do I plot array as first element on it is x-axis and 2nd is y axis , then I get it's equation ?
Use plot to plot your data, and use <http://www.mathworks.com/help/curvefit/fit.html fit function> to fit a function to your dat...

10 years ago | 0

Answered
display image in subfolder of current folder
filename='photo.jpg'; % your image a=dir b={a.name}; idx=cellfun(@isdir,b) c=b(idx) c=c(3:end) for k=1:numel(c) f=d...

10 years ago | 0

Answered
Index exceeds matrix dimensions when doing simulation
Check the sizes of your variables, and don't exceed these dimensions. For example if your matrix A is 4x3, you can't write A(5,1...

10 years ago | 0

Answered
adding array into simulink
Use a <http://www.mathworks.com/help/simulink/slref/selector.html selector block>

10 years ago | 0

| accepted

Answered
Applying a negative to the function to find the maximum
f=@(x)p1*x^4+p2*x^3+p3*x^2+p4*x+p5 h=@(x)-f(x)

10 years ago | 0

Answered
how to split arrays into different ranges?
a=[2,8,3,30,4,50,100,200,4,80,500]; [~,jj]=histc(a,[0 10 100 1000 ]); out=accumarray(jj',(1:numel(jj))',[],@(x) {a(x)}); ce...

10 years ago | 0

Answered
How to combine the matrices that are output by the for loop.
s = 1:100; d = reshape(s, [10 10])'; d = mat2cell(d, ones(1,10), 10); k2 = length(d) * 5; out=[]; for k1 = 1:length(d) ...

10 years ago | 0

| accepted

Answered
find an element in a pair and return the counterpart
node_pair_list= [1, 2;2, 3; 4, 3; 3, 6; 5, 6 ] idx=ismember(node_pair_list,3) out=node_pair_list(any(idx,2),:)

10 years ago | 0

| accepted

Answered
how to find repeated value in a matrix?
That depends on how you use ismember, you have also to specify if you are looking for dates in u or in v u=[10 25; 10 26; 1...

10 years ago | 0

| accepted

Answered
Problem Implementing a sine wave with increasing frequency
If the maximum frequency is f=50, set the max step size (in model configuration parameters) to 0.1/f

10 years ago | 0

Answered
merge arrays into a new one with a specific element sequence
A=[1; 2; 3] B=[4 ;5; 6] C=[A B]' C=C(:) Or A=[1; 2; 3] B=[4 ;5; 6] C=reshape([A B]',[],1)

10 years ago | 3

| accepted

Answered
Truncating a number without rounding
fix(a*10)/10

10 years ago | 3

| accepted

Answered
error: Function definitions are not permitted in this context
ProbabiltyMatrices is a function, you can't run it by clicking run. To use this function, assign values to X= Lam= Y= ...

10 years ago | 0

Answered
How do I convert a 3 x3 cell to a 3 x 1 cell?
a=[1 1 0;1 0 1;0 0 1] b=num2cell(a,2) If a is a cell array a={1 1 0;1 0 1;0 0 1} b=num2cell(cell2mat(a),2)

10 years ago | 1

| accepted

Answered
Fields in a Structure
Use fieldnames

10 years ago | 0

| accepted

Answered
the values of coordinates in matlab
idx=[1 2; 1 3; 2 4] ii1=idx(:,1) ii2=idx(:,2) jdx=sub2ind(size(s),[ii1(:);ii2(:)],[ii2(:);ii1(:)]) s(jdx)=0

10 years ago | 1

Answered
One half sine wave simulink
Create a file filename.mat A=1; T=2*0.01; f=1/T; t=0:0.001:0.3; idx=t<0.1 | t>0.11; y=A*sin(2*pi*f*(t-0.1)); y(idx)=...

10 years ago | 0

| accepted

Answered
How to multiple a given element of a column vector across the elements of a row in a matrix, for each corresponding row.
X = [1 2 3]' y = [1 1 1; 1 1 1; 1 1 1] out=bsxfun(@times,y,X)

10 years ago | 0

| accepted

Answered
Use ilaplace on a transfer function and set it as value of a text box.
set(handles.text9, 'String', char(g));

10 years ago | 1

| accepted

Answered
MATLAB index exceeds matrix dimensions error.
Check this line p = fj(j).*((x - xj(j+1)).*(x-xj(j+2)))./((xj(j) - xj(j+1)).*(xj(j) - xj(j+2))) ... + fj(j+1).*((x -...

10 years ago | 0

Answered
Cellplot with values at each element
This is my example a=num2cell(rand(4)) cellplot(a) Now what is in your example that is not working ?

10 years ago | 0

Answered
store data associated with index in simulink and then export to workspace
This is a very bad idea to save your data with different names. Use a to workspace block to have your data in workspace. And one...

10 years ago | 0

| accepted

Answered
how to truncate an array containing 500 elements?
A=rand(1,500) % example A(101:end) Read <http://www.mathworks.com/help/matlab/matrices-and-arrays.html>

10 years ago | 0

Answered
Uppercase string from the cell array
out=a(cellfun(@(x,y) isequal(x,y),a,upper(a))) or out=cell(size(a)) idx=cellfun(@(x,y) isequal(x,y),a,upper(a)) out(...

10 years ago | 2

Load more