Answered
n term series using For loop
It's for k=1:n

13 years ago | 0

Answered
Elementwise diff() with an condition
X = {[1,2,4,5],[23,12,13]} B=1 for k=1:numel(X) b=diff(X{k}) b(b>B)=[] out{k}=b end

13 years ago | 0

Answered
How to combine input functions
te=0.3 fe=1/te t1=0:.001:0.15 y1=sin(2*pi*fe*t1) t2=0.151:0.001:1 y2=t2*0 t=[t1 t2] y=[y1 y2] plot(t,y)

13 years ago | 0

| accepted

Answered
How do I add a title to each subplot?
title('sin(delta)')

13 years ago | 1

Answered
User defined functions for standard deviation
sum and mean are built-in functions, use instead for example som and moy. You should use two for loop, the first to calculate...

13 years ago | 1

Answered
Problem with indexing within a vector
x = [-10 5 4 -10]'; y = [2 -2 10 -3]'; idx=abs(x)>abs(y); s=y; s(idx)=x(idx); z=sqrt(x.^2 + y.^2).*sign(s)

13 years ago | 0

| accepted

Answered
Is it possible to copy the elements of a matrix to a set of variable names ?
A=rand(1,6) s='abcdef' for k=1:numel(s) assignin('base',s(k),A(k)) end

13 years ago | 0

Answered
convert cell array to string
c2=A(:,2) idx=cellfun(@(x) isnumeric(x)& ~isnan(x),c2) c2=cellfun(@num2str,c2,'un',0) A(idx,2)=c2(idx)

13 years ago | 0

Answered
Move Matlab installation folder
I do not think you can move matlab installation folder, If it's possible, it will be complicated to do.

13 years ago | 1

Answered
Butterworth filter in simulink
There is no block named Butterworth, look at <http://www.mathworks.com/help/dsp/ref/analogfilterdesign.html Analog Filter Design...

13 years ago | 5

| accepted

Answered
matlab code about function of quantization
One way how a real ADC works % for values from 0 to 10 n=12 q=10/(2^n-1) max_val=10/2 u=6.5555 % Example bit=zeros(...

13 years ago | 0

Answered
Increase precision of plot axes
s=sprintf('%10d',145500000)

13 years ago | 0

Answered
traverse the list of array elements
Use for i=1:length(a)-1

13 years ago | 0

| accepted

Answered
How do I read the last document from a directory
d=dir('*.mat'); % if you need mat files dates={d.date}; files={d.files}; [~,idx]=sort(datenum(dates)); new_file=files{id...

13 years ago | 0

| accepted

Answered
matlab code about function of quantization
function [symbols_quant]=quantization(y) b=12 q=2/(2^b-1) symbols_quant=round(y/q)*q

13 years ago | 0

Answered
Removing values form the Matrix
for k=1:size(B,1) if isequal(B(k:k+1,:),A) idx=k break end end B(idx:idx+1,:)=[] ...

13 years ago | 0

| accepted

Answered
Extracting rows of a matrix
out=a(2:end,:) % If you want row 10 a(10,:)

13 years ago | 0

Answered
Comparing 2 vectors: finding closest point
x=[1 2 3 4 5]; y=[0 1.1 1.5 1.6 2.4 4.1 4.7 5 5.7]; for k=1:numel(x) [val,idx]=min(abs(y-x(k))); xx(k)=y(idx); en...

13 years ago | 0

Answered
Modifying a large sparse matrix efficiently
Define your tolerence tol tol=0.001 a(abs(a)<tol))=0

13 years ago | 0

Answered
How to add text to legend
legend({num2str(tC1),num2str(tC2)})

13 years ago | 0

Answered
Is there a command of "not less than or equal to " to vectors?
all(a<=b)

13 years ago | 0

| accepted

Answered
Copy of one field of a structured array
C=struct('B',{A.B})

13 years ago | 1

Answered
Creating new model or block instances during run-time...
What you can do, is pause simulation, add a block then continue simulation using set_param('yourmodel','SimulationCommand',...

13 years ago | 0

Answered
How to retrieve data entered in an edit box
s=str2double(get(handles.editboxname,'string')) % editboxname is the tag of your edit box.

13 years ago | 0

| accepted

Answered
How to Loop through a matrix/array
a=rand(1,804) %example m=numel(a); n=ceil(m/58); r=n*58-m; for k=1:n-1 idx1=(k-1)*58+1; idx2=k*58; assignin...

13 years ago | 0

Answered
How to Loop through a matrix/array
If you want a3 just use n=3 idx1=(n-1)*58+1 idx2=n*58 out=a(idx1:idx2)

13 years ago | 0

Answered
generate random numbers in range from (0.8 to 4)
xmin=0.8 xmax=4 n=20 x=xmin+rand(1,n)*(xmax-xmin)

13 years ago | 23

| accepted

Answered
how to Subtract Complex Values Matrices?
M1=xlsread('file1.xls') M2=xlsread('file2.xls') M=M1-M2

13 years ago | 0

Answered
How do I Delete Array Elements
x = [1 2 4 7 8 10 15 18 22 31]; x([6 7 9])=[]

13 years ago | 0

Answered
Process each element in my buffer ?
A=[1 2 3 4 5 6 7 8 9 10 2 3 4 5 6 7 8 9 10 1 3 4 5 6 7 8 9 10 1 2] out=sum(A)/2

13 years ago | 0

Load more