Answered
Help with removing arrays from structure array?
When you write for k=1:2 data(k)=[] end at the first iteration, the size of of data2 will be equal to 1. then, w...

11 years ago | 0

| accepted

Answered
Is there a way to manipulate the Font that is displayed in the Command Window?
Type preferences then choose font- custum - Command Windows and change the font

11 years ago | 1

Answered
Detect in simulink if the current and past 4 values are same or not
You can use Matlab function without any delay block. function y = fcn(u) %#codegen persistent u1 u2 u3 u4 if isempty(u1...

11 years ago | 0

Answered
Appending one cell array to non-zero cells of another
out=cellfun(@(x,y) [x y],FINAL_OUTPU,indexing,'un',0)

11 years ago | 0

Answered
Access the array index using find
a= [1 12 23 45]; b= [45 23] out=arrayfun(@(x) find(a==x),b,'un',0) Or using a for loop. The previous answer, also uses a ...

11 years ago | 0

| accepted

Answered
how to check if two elements are in a row of a matrix?
A=[1 2; 4 5; 6 9 1 8] B=[1 3 5 6; 1 2 4 7; 5 6 4 8; 1 2 3 4] out=[]; for ii=1:size(A,1) ...

11 years ago | 0

Answered
how to run a Simulink model in a Matlab M file in this way?
Use <http://www.mathworks.com/help/simulink/slref/set_param.html set_param>

11 years ago | 0

Answered
how i can have dimension input of a defined function like f ?
f=@(x,y)(x+y) s=func2str(f); a=regexp(s,'(?<=@\()[\w,]+(?=\))','match') out=numel(cell2mat(regexp(a,'\w+')))

11 years ago | 0

| accepted

Answered
how to input a matrix
You can use a table <https://www.youtube.com/watch?v=O4LKSR7i2IU>

11 years ago | 1

Answered
Manipulating cell arrays based on index
jj=cell(100,1) jj(1:100) = num2cell(ones(100,1))

11 years ago | 0

Answered
In an assignment A(I) = B, the number of elements in B and I must be the same.
Nt=T/dt+1; t=0:dt:T; phi=zeros(Nt,1); b=zeros(Nt,1); f=zeros(Nt,1); p(1)=3; b(1)=10; f(1)=l; for i=1:Nt-1 b(i)=(1...

11 years ago | 0

| accepted

Answered
How to change variable name from known string?
assignin('base',Old_var,'New_var')

11 years ago | 4

| accepted

Answered
Changing the name of TXT file
YourFolder='C:\Documents and Settings\Mes documents\MATLAB' f=dir(fullfile(YourFolder,'*.txt')); g={f.name}; s=regexp(g...

11 years ago | 0

| accepted

Answered
Reading data from workspace.
You can use a <http://www.mathworks.com/help/simulink/slref/selector.html Selector block>

11 years ago | 0

Answered
How to get the pixel values of an image according to a given sequence.?
IM=[12 45 44; 43 13 23; 33 98 99] SEQ=[1 4 5 8 2 3 9 6 7] [x,y]=ind2sub(size(IM),SEQ)

11 years ago | 0

| accepted

Answered
How to collect non-integers from for loop in one matrix?
ii=0; for k=1:.5:10 ii=ii+1 y(ii)=k end or k=1:.5:10 for ii=1:numel(k) y(ii)=k(ii) end

11 years ago | 0

| accepted

Answered
I want to convert the numbers in the matrix as the letter .
b=input('enter a number'); str=['A':'Z' '.?'] if ismember(b,1:28) out=str(b) disp(out) else disp(' ') end...

11 years ago | 0

| accepted

Answered
How to Determine Column(s) with Most Non-zero values in a matrix?
A=randi([0 1],8) [~,idx]=max(sum(A))

11 years ago | 0

Answered
Import Excel Graph into Matlab
Import your data with xlsread, then plot what you want

11 years ago | 0

Answered
How can I calculate ln(x) in matlab code?
log(x)

11 years ago | 16

| accepted

Answered
why does the year function not work as specified in documentation?
Check if year is not used as a variable. Try this clear year year('12-dec-1992')

11 years ago | 0

Answered
Error using the Matlab function block in Simulink
Read this <http://www.mathworks.com/help/fixedpoint/ref/coder.extrinsic.html> <http://www.mathworks.com/help/simulink/ug/functi...

11 years ago | 0

| accepted

Answered
How to create legend for each point?
%Look at this example which doesn't work t=[0 1 2 3 4 5] y=sin(t) plot(t,y) leg={'0' '1' '2' '3' '4' '5'} l...

11 years ago | 0

Answered
How to merge first elements from 2 array into an new array?
C=reshape([A;B],1,[])

11 years ago | 0

Answered
How to write to a text file without overwriting existing file content in matlab
a=rand(4) b=[1 2 3;4 5 6] dlmwrite('file.txt',a) dlmwrite('file.txt',b,'-append')

11 years ago | 0

| accepted

Answered
How to join two matrix arrays together
C=[A B] Read this <http://www.mathworks.com/help/matlab/math/creating-and-concatenating-matrices.html>

11 years ago | 1

| accepted

Answered
array of structures in matlab
array1=1:10 array2=21:30 out=struct('field1', num2cell(array1),'field2',num2cell(array2))

11 years ago | 0

| accepted

Answered
I have a string with the form of that of what you would write to initialize a matrix; how do I make the string a matrix?
myStr = '[1,2,3, 5:7]' out=evalin('base',myStr)

11 years ago | 0

| accepted

Answered
make run a script programme by a simulink bloc's
Read this <http://www.mathworks.com/help/simulink/ug/using-callback-functions.html> # Click on any area of of your Simulink m...

11 years ago | 0

| accepted

Answered
Deleting or selecting rows of a struct with a condition
Don't use == for i=1:numel(logfile) if ~isequal(logfile(i).code,'p') && ~isequal(logfile(i).code,'H') logfil...

11 years ago | 1

Load more