Answered
Calculate mean of column in structure if another row = 1
v=[ 1 325 0 359 1 410 1 425 0 371 1 448] A=struct('correct',num2cell(v(:,1)),'latency',num2...

12 years ago | 0

| accepted

Answered
generate same random matrix in another computer..
Use rng rng(10) rand(4)

12 years ago | 0

| accepted

Answered
Matrix multiplication using inv()
A = inv(B)*I'

12 years ago | 0

Answered
rmfield / clear structur entry ?
A=struct('x',num2cell(rand(1,5)),'y',num2cell(rand(1,5)),'z',num2cell(rand(1,5))) A(3)=[]

12 years ago | 0

Answered
how to find the maximum value of an image by using buit-in function in matlab?
max function is a built-in function

12 years ago | 0

| accepted

Answered
where to find memory limit
Type memory

12 years ago | 0

Answered
What is the difference between if-else block and a switch block in simulink?
# The switch block has 2 input signals and a third input (in the middle of the block) that indicate if the first or second signa...

12 years ago | 0

Answered
Need help to remove simulink model error
Go to InitFcn and show us the code

12 years ago | 0

| accepted

Answered
How to get location of signal name on signal line
Look at this answer <http://www.mathworks.com/matlabcentral/answers/109816-how-i-can-find-the-connection-between-two-blocks-of-s...

12 years ago | 0

Answered
how to import matrices from workspace to simulink block?
You have not to import them, If your matrices are A,B,C and D, just set the SS block parameters to A, B, C and D

12 years ago | 1

| accepted

Answered
values of randi function repeat themselves
Use <http://www.mathworks.com/help/matlab/ref/randperm.html randperm> function

12 years ago | 0

| accepted

Answered
Replace values in a matrix with ones from other matrix based on some criteria
ii=isnan(A) A(ii)=B(ii+1)

12 years ago | 0

Answered
Removing all-NaN Rows/Columns from Cell Matrix?
A = { 0 2 'All' NaN NaN 2 NaN NaN NaN NaN NaN NaN NaN NaN 'Yes' NaN NaN 1} idx=cellfun(@(x) all(i...

12 years ago | 3

| accepted

Answered
New variable based on a 'percentile' condition
B={53 49.3 51.7 49.2 48 40 41} A=[1983 11 54 1983 13 24 1983 16 32 1983 20 11 1983 25 14 1983 28...

12 years ago | 1

| accepted

Answered
Is it possible to vectorize this loop?
A =[1 2 3 4 5 6;4 5 6 5 6 7;7 8 9 10 11 12;]; B=sum(A,1); C=mean(B); E=30*C/100; F=and(B>=C-E,B<=C+E); F=repmat...

12 years ago | 0

| accepted

Answered
Sort complicated Array low -->top
A={'J_012(105)' 'J_013(106)' 'J_014(107)' 'J_015(2)' 'J_016(94)' 'J_017(95)'} s=regexp(A,'(?<=\().+(?=\))','match') [~,...

12 years ago | 0

| accepted

Answered
i got an error as Warning: Ignoring extra legend entries
close all clc [I1,I2,I3]=deal(1:10); flux1=sin(l1) flux2=cos(I2) flux3=sin(I3).^2 figure('name','flux vs current'); h1=...

12 years ago | 2

Answered
Simple time in simulink
For each input of the second subsystem add a zoh block with a sample time of your choice, you can use the same block at the outp...

12 years ago | 0

Answered
How to flip only some rows inside a matrix?
A(2:2:end,:)=fliplr(A(2:2:end,:))

12 years ago | 2

| accepted

Answered
how to convert a cell containig 8bit niary sequence to integer value
A={'01001100' '01011110' '00110110' '10010100' '01100000' '01000000' '10011100' '00101101' '11011100'} B=cellf...

12 years ago | 0

| accepted

Answered
How do I assign unique values to a i*j matrix/grid?
m=[1 2 3 4 5] n=[3 2 1] kn=numel(n); km=numel(m); l=zeros(kn,km); % preallocate for i=1:numel(n) ...

12 years ago | 1

Answered
Make a vector of 1's and zeros
A=[1 2 3 4] B=[2 6 1 5] [C,idx]=sort([ A B]) C(idx<=numel(A))=1; C(idx>numel(A))=0

12 years ago | 0

| accepted

Answered
Scramble the positions of a cell array
Z= {[2,5] [2,3] [2,1] [2,2] [2,4] [4,5] [4,3] [4,1] [4,2] [4,4] [5,5] [5,3] [5,1] [5,2] [5,4] [3,5] [3,3] [3,1]...

12 years ago | 0

| accepted

Answered
How to read some specific columns from xls file with matlab
data1=xlsread('file.xlsx','C:C'); data2=xlsread('file.xlsx','E:E'); data=[data1 data2]

12 years ago | 4

| accepted

Answered
Counting total number of peaks in an array??
numel(findpeaks(your_signal)) %or numel(gradient(your_signal)==0)

12 years ago | 2

| accepted

Answered
How to know time that spent matlab in solving problem?
Use tic toc

12 years ago | 0

Answered
find the same values and average it out
A =[ 66 2 66 3 66 4 67 6 67 3 68 5 69 6 69 3] [ii,jj,kk]=unique(A(:,1)) out=[ii ...

12 years ago | 1

Answered
How to find two arrays of a matrix are equal? and find their location in that matrix??? for example>>> suppose we have a=[1 3 5 6 3 7] how to find which arrays are equal with each other? and find their location??? thank you very much
a=[1 3 5 6 3 7] [b,ii,jj]=unique(a) [freq,idx]=histc(a,b) location=arrayfun(@(x) find(a==x),b,'un',0) out=[{'a' 'frequenc...

12 years ago | 0

| accepted

Answered
change name of variable completely in a loop
<http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F>

12 years ago | 0

Load more