Beantwortet
why "symsum(sin(k*pi)*k,0,n)" not equal zero
I don't think Matlab recognizes that sin(pi)= 0, therefore it cant simplify further sin(pi*n)*(n/2 + 1/4). Just type sin(pi) and...

mehr als 10 Jahre vor | 0

Beantwortet
Testing for statistical independence of two vectors
Correlation is one method to check dependence: x=1:100; y=1:100; correl = corr(x(:),y(:)) x=rand(1,100); y=...

mehr als 10 Jahre vor | 0

Beantwortet
Interpolation and missing values
x_gap = x(2:end)-x(1:end-1); ind=find(x_gap>0.025); ind_int=[]; for j=1:numel(ind) ind_int = [ind_int,find((xi...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Putting figures within rectangles
x=1:10; y=1:10; figure; subplot(2,2,1) plot(x,y); t=title('a'); subplot(2,2,2) plot(x,y); t...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
How can I refer to the diagonals of a matrix?
In case you want to use the diagonal values without saving the locations of the values, you can use diag. diag(A,0) is ...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Nested for loop still not working...
You should do for k = 1:length(InstNames) for i = 1:length(DataNames) So add the 1:. This: for k = length(Inst...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Fzero Issues with complex equation with complex roots
The value of the function at pi is 10, not 0. Do you mean you want the value where the imaginary part of the function is 0? Then...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Matrix Calculation in MATLAB
Define x as symbolic variable. Also (2-x * 3-x) should be ((2-x) * (3-x)) else you are calculating (2- (x * 3) -x). So: sy...

mehr als 10 Jahre vor | 0

Beantwortet
Getting wrong results with fft
y = signal; %the signal you want to fft L = length(y); NFFT = 2^nextpow2(L); % Next power of 2 from length of y Y = ...

mehr als 10 Jahre vor | 0

Beantwortet
Slope of a line
(max([50 50])-min([50 50])) returns 0, since the minimum and maximum of the vector [50 50] is 50. This means that X=0 and ...

mehr als 10 Jahre vor | 0

Beantwortet
Frustrating for what should be simpleā€¦ What have I done wrong?
For strings you shouldn't use == to compare but strcmp for case sensitive comparison or strcmpi for not case sensitive. So this ...

mehr als 10 Jahre vor | 3

| akzeptiert

Beantwortet
Calculating mean for lines generated from Hough Transform
Maybe something like this is what you need: mean_vec=[]; for ii=1:length(Meanpix) x=cell2mat(Meanpix{ii}); ...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Logistic Population growth... w. linear regression and polyfit
I dont understand what you want to do with the fit but the numbers are correct: coeff=polyfit(t,n,1) n_fit = polyv...

mehr als 10 Jahre vor | 0

Beantwortet
Eigenvalue decomposition of very large matrices
If you have a sparse matrix (lots of zeros), you should use eigs (determines the eigenvalues of a sparse matrix). First declare ...

mehr als 10 Jahre vor | 1

Beantwortet
How can I add rabdom variables to an ode
rand gives a random value between 0 and 1. The arguments of rand are not the boundaries but the size (of the matrix) of the outp...

mehr als 10 Jahre vor | 0

Beantwortet
Can two first order transfer functions be added together in matlab to make a second order transfer function
Yes, unlike Mischa said you do get a second order tf because g and g1 do *not* have a common denominator. The result is: g2...

mehr als 10 Jahre vor | 0

Beantwortet
How to use fminunc providing gradient and hessian?
What Matt said and the way you want to calculate the gradient and hessian is not gonna work. since val is just a single value, t...

mehr als 10 Jahre vor | 0

Beantwortet
How to solve algebric loop in a simulink model?
Put a delay or memory block in the signal of the variable which gives the algebraic loop. The problem is that you probably use...

mehr als 10 Jahre vor | 2

Beantwortet
Replace zero in a matrix with value in previous row
idx=find(A==0) A(idx)=A(idx-1)

mehr als 10 Jahre vor | 0

Beantwortet
can you help me to ploting the number of operations and time of execution
Do you mean something like this: n=10000; i=47; j=0; while mod(n, i)~=0; if(j==0) ti...

mehr als 10 Jahre vor | 0

Beantwortet
Only check if statement once, or, disable code block after 1 check
Sounds like persistent variables may one of the solutions here. Persistent means that the variable will still remember its value...

mehr als 10 Jahre vor | 0

Beantwortet
How to plot an equation with two independent and one dependent variable?
it plots only points in vertical line because when you plot k has only a single value, namely 100. Add k=1:100; before the plot ...

mehr als 10 Jahre vor | 0

Beantwortet
is it possible to close popup using command!!
If you want to close it immediately after it stops flashing you can add close gcf after the end. Or add a pause before...

mehr als 10 Jahre vor | 1

| akzeptiert

Beantwortet
Why I can not do this surf?
Because Z should be a 144*144 matrix. 1 value for each pair of x and y values.

mehr als 10 Jahre vor | 0

Beantwortet
Problem in exporting figure: Can anyone fix a bug in this code?
Try using <http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig export_fig> for saving to .eps or .pdf. It works ...

mehr als 10 Jahre vor | 0

Beantwortet
How can I create a new matrix with x and y coordinates using a for loop?
[y,x]=find(A==1); num=length(x); B=[(1:num)',x,y]; If you want to sort the points the way you described do for exampl...

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
How can I built a new matrix in a new method?
ind = find(Assem{1}==0); Assem{1}(ind)=[]; C(ind)=[];

mehr als 10 Jahre vor | 0

| akzeptiert

Beantwortet
Hello I have problem to connect line from solar cell block to inverter. I can't connect that line
That's because you have two outputs to the same point. If you want to add them use an add block.

mehr als 10 Jahre vor | 0

Beantwortet
How to download a particular function of MATLAB ?
Type ver in matlab, a list of the installed toolboxes should appear. Check if Computer Vision System toolbox is installed. It it...

mehr als 10 Jahre vor | 0

Beantwortet
How can I use "impulseest" to recreate the results of the deprecated "impulse" function?
Well, there is impulseestOptions where you can define input offset. I don't know much about this problem so can't help you much ...

mehr als 10 Jahre vor | 0

Mehr laden