Answered
The art of delaying (discrete)
Set the sample time of your unit delay block to T/4, you will get a signal containing 4x number of original samples, delayed wit...

13 years ago | 0

Answered
creating a list from another list
mylist = {'ABCD', 'DEFG', 'HIJKL'} out=cellfun(@(x) x(1:3),mylist,'un',0)

13 years ago | 0

| accepted

Answered
Collect for loop output into one variable
m=13:21 for o=0:61; b(o+1,:)=m+(11*o) end b=b', out=b(:)' %or m=13:21 b=[]; for o=0:61; b=[b m+(11*o)] ...

13 years ago | 1

| accepted

Answered
What is the purpose of Resampling if it doesn't change the original bandwith of the signal?
Resampling will not change the bandwidth of the original signal, it allows to have less samples to be treated, which means less ...

13 years ago | 0

| accepted

Answered
problem with entering variables in a function
Use if 105<h & h<120 and elseif 100<h & h<105

13 years ago | 0

| accepted

Answered
Easy question from a newbie
size(A,1) % number of rows size(A,2) % number of columns size(A,3) % number of channels

13 years ago | 0

| accepted

Answered
How to copy a sub-matrix/vector along diagonal of a larger matrix with varying number of sub-matrices?
a=[1 2 3] n=5 d=[a zeros(1,numel(a)*(n-1))] out=cell2mat(arrayfun(@(x) circshift(d,[0 (n-1)*x]),(0:n-1)','un',0)) *EDIT*...

13 years ago | 0

Answered
How to copy a sub-matrix/vector along diagonal of a larger matrix with varying number of sub-matrices?
n=10 a=[1 2 3] s= ['@(x1)blkdiag(x1' sprintf(',x%d',ones(1,n-1)) ')'] blkdiagn=str2func(s) out=blkdiagn(a)

13 years ago | 0

Answered
How to give sample time to NCO block in Simulink and how it will be interacting with other block having different sample time?
Pass the NCO output signal through a zoh block and set its sample time (the zoh sample time)

13 years ago | 2

| accepted

Answered
how to convert a double matrix image to a unit8 matrix ?
A=imread('yourimage') B=uint8(A) *EDIT* d=linspace(min(im(:)),max(im(:)),256) im1=uint8(arrayfun(@(x) find(abs(d...

13 years ago | 8

| accepted

Answered
How to modify the handles structure (GUI) from an external function
Use function [matrix, indexVector] = myFunction(hObject,handles) handles.variable1 = 1; guidata(hObject,handles)

13 years ago | 1

Answered
Calling a function with input size that varies.
I'm not sure to understand, I think you can use one cell array containing all your inputs

13 years ago | 0

Answered
Creating a for loop that adds a number to a letter
for k=1:99 s{k}=sprintf('X%d',k) end

13 years ago | 0

| accepted

Answered
Finding the value of one column based on another column
[ii,jj]=find(A(:,2:6)==0.5) out=A(ii,1)

13 years ago | 0

| accepted

Answered
How can I write a function that draws a regular polygon with n sides in a polar coordinate plot?
close sides=5 degrees=2*pi/sides theta=0:degrees:360-degrees radius=ones(1,numel(theta)) polar(theta,radius)

13 years ago | 1

| accepted

Answered
Solve a second order differential equation
% x1=y %x2=dy Then %dx1=dy=x2 %dx2=d2y=-w^2*y=-w^2*x1 save this function as yourfcn function dx=yourfcn(t,...

13 years ago | 2

| accepted

Answered
Changing the Value of the Origin.
You can use xlim and ylim

13 years ago | 0

Answered
Can we run simulink by m file when simulink interface is not opened
Yes you can do it, without even loading or opening your model

13 years ago | 0

Answered
Why the code gives an error?
You are using *sum* as a variable, and as a function in sum = sum+A(i,j)*X(j,1); d = sum(Z);

13 years ago | 1

| accepted

Answered
how to discretize a continuous PID controller.?? in simulink... without using discrete PID block..??
You can discretize your PID controller by adding a <http://www.mathworks.com/help/simulink/slref/zeroorderhold.html zoh> block,...

13 years ago | 0

Answered
vector of strings to cell array
B=arrayfun(@num2str,A,'un',0)

13 years ago | 0

| accepted

Answered
Question about Taylor Series While loop.
Try this x = input('Input the angle in radians: '); Cos_Estimate = 1; Errrr=1 Sign = 1; k = 0; while Errrr > .000001 &...

13 years ago | 0

| accepted

Answered
Question about Taylor Series While loop.
Your code never enter in the loop because Errrr is not defined

13 years ago | 0

Answered
ln is not working, please help me
One solution is b=log10(y)/log10(x) Example x=50; y=24 b=log10(y)/log10(x) And now check x^b

13 years ago | 0

| accepted

Answered
Change the color of singal line in Simulink (2012b)
with your mouse(right click) set the foregroundcolor

13 years ago | 2

Answered
sampling a continuous signal.
Calculate the fft of your signal, then deduce approximately the highest frequency fmax of your signal The sample frequency sh...

13 years ago | 0

Answered
How to create a waterfall plot with two matrices and a vector
Example m=10; n=40; z= sort(rand(m , n),2) y = randi(m,m,1) x = rand(m, n) xx=x(y,:) zz=z(y,:) plot(zz',xx')

13 years ago | 0

Answered
creating multiple excel files
Example data={rand(4),rand(6),rand(8)} n=3, % number of files for k=1:n xlswrite(sprintf('file%d.xls',k),data{k}) ...

13 years ago | 0

Answered
Adding additional Information to a figure/plot
Use <http://www.mathworks.com/help/matlab/ref/text.html text> command

13 years ago | 0

Answered
curve of best fit from a few points
x=[1 1.5 2 2.5 3]; y=[19.74 14.26 12.34 11.45 10.97]; xi=1:0.2:3 method='spline' yi=interp1(x,y,xi,method) plot(xi,yi)...

13 years ago | 2

| accepted

Load more