Answered
I have to calculate the sum of multiple coefficients which depends upon the value 'm'.
Look at this example y=@(m) sin(m) out=sum(y(1:10)) % for m=10

10 years ago | 0

| accepted

Answered
Plot with loop work only for the last
Use hold on

10 years ago | 0

| accepted

Answered
How can I convert A=[1 3 2] to B= [ 1 0 0;0 0 3;0 2 0] ?
A=[1 3 2]; n=numel(A) idx=sub2ind([n n],A,1:n) B=zeros(n) B(idx)=A

10 years ago | 0

| accepted

Answered
finding minimum values in a matrix of array nx1
Use sort function a=sort(A) out=a(1:10)

10 years ago | 0

| accepted

Answered
carry addition in a binary number
v='100111' w=dec2bin(bin2dec(v)+1)

10 years ago | 0

Answered
How do I find the zero values in an array and place them into cells by using loops?
A =[1,0,2;0,0,1;3,0,2] [ii,jj]=find(A==0) v=[zeros(numel(ii),1) ii jj] h={'value' 'row' 'column'} out=[h; num2cell(v)]

10 years ago | 0

Answered
Bar groups multiple line styles
y = [2 2 3; 2 5 6; 2 8 9; 2 11 12]; h=bar(y) LineArray={ '-' , ':' '--' }; for k=1:3 set(h(k),'LineStyle',LineArray{k...

10 years ago | 0

| accepted

Answered
How to draw a graph of this equation,
use plot functon

10 years ago | 0

| accepted

Answered
how do i replace part of Symbolic Matrix ?
delta = sym('R%d%d',[3,3]) v=sym('R',[3 1]) idx=sub2ind(size(delta),1:3,1:3]) delta(idx)=v

10 years ago | 0

Answered
how to plot a graph of this equation?
x=-10:0.1:10 Y=1./(x.^2)+8 plot(x,Y)

10 years ago | 4

| accepted

Answered
How can I write this formula in Matlab?
xi=2 x=[1 2 3] N=3 out=sum((xi-x).^2)/N

10 years ago | 0

Answered
How do I select some data from a matrix?
[~,ii]=unique(A(:,1),'stable'); jj=sort([ii,ii+1]); out=A(jj,:)

10 years ago | 2

| accepted

Answered
How to count the number of each character from a text file (and the frequency of it)?
s=importdata('file.txt') str=upper(s(:)) str=[str{:}] AZ='A':'Z' long=sum(ismember(str,AZ)); for k=1:numel(AZ) freq(...

10 years ago | 6

| accepted

Answered
How Can I Manipulate Multiple Matrices at Once
catal01=rand(10,1) catal02=rand(10,1) catal03=rand(10,1) v=[] for k=1:3 a=evalin('base',sprintf('catal%0.2d',k)) ...

10 years ago | 0

Answered
how can i plot data with 4 y-axis versus a x-axis?
T=[15,15,15,15,15] sfc=[664.5678485,613.2928213,621.5065644,598.2334518,645.379002] nf=[12.74600969,13.81165398,13.62912111,...

10 years ago | 0

| accepted

Answered
Create semilogy plot with original values on Y-Axis
set(gca,'ysclae','log')

10 years ago | 0

Answered
removing rows containing certain values
A=rand(3,3) idx=any(A<0.1 | A>0.9,2) out=A(idx,:) A(idx,:)=[]

10 years ago | 0

Answered
Changing horizontal x axis from 0-1-0?
%-----Example--------- t=0:0.1:20 y=sin(t); plot(t,y) %------------------------- xl=get(gca,'xlim') xti=[0.2:0.1:1 0.9...

10 years ago | 0

| accepted

Answered
Convert matrix of char to numbers
v=['123';'456';'789';'456'] [n,m]=size(v) w=str2double(mat2cell(v',ones(m,1),n))

10 years ago | 0

Answered
how to get refractory period in neuron of long vector 1*1500000 as [0 1]?
v=[0 0 0 1 1 1 0 0 1 0 1 0 1 1] idx=v(5:5:end)

10 years ago | 1

Answered
How to open text file with headers through matlab code?
Data = textscan(fid,'%s','delimiter','\n','HeaderLines',number_of_lines_to_skeep)

10 years ago | 0

Answered
merging column elements into one
Look at this example v={'2016' '03' '02' '12:10:00';'2016' '03' '02' '13:20:00'} out=arrayfun(@(x) [v{x,1} '-' v{x,2} '-' ...

10 years ago | 0

Answered
How to locate a string in Matlab, getting the index of the string?
A = {'abc','de','fghij','something','another'} idx=find(ismember(A,'fghij'))

10 years ago | 1

| accepted

Answered
How to place a cone along a line?
% get the coordinate x, y and z [x,y,z]=cylinder([0 1]) % New coordinate x=x+2 y=y+10 z=z+5 %----new cone---------- m...

10 years ago | 0

Answered
is there any real time clock in the Simulink?
If you have a <http://www.mathworks.com/products/simulink-desktop-real-time/ simulink-desktop-real-time toolbox> you can use a c...

10 years ago | 0

Answered
Getting Real & Imaginary Numbers From Nyquist(Sys)
%----Example----- h=tf(1,1:2) %------------------ [re,im,freq]=nyquist(h) re=squeeze(re) im=squeeze(im) plot(re,im)

10 years ago | 1

Answered
Can't save Simulink simulation results after changing parameter
Use a cell array simout_store{i}=simout(:,1)

10 years ago | 0

| accepted

Answered
for loop, indexing issues, and graph conversion to binary matrix
% This is correct extH= zeros(501); x = -250:250; y = x.^3 / 62500; The problem is this line extH(1:501,y)=1;...

10 years ago | 0

Answered
how to stop simulink file ?
set_param(gcs, 'SimulationCommand', 'stop')

10 years ago | 0

Load more