Risposto
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...

quasi 12 anni fa | 0

Risposto
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=...

quasi 12 anni fa | 0

Risposto
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...

quasi 12 anni fa | 0

| accettato

Risposto
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...

quasi 12 anni fa | 0

| accettato

Risposto
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 ...

quasi 12 anni fa | 0

| accettato

Risposto
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...

quasi 12 anni fa | 0

| accettato

Risposto
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...

quasi 12 anni fa | 0

| accettato

Risposto
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...

quasi 12 anni fa | 0

Risposto
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 = ...

quasi 12 anni fa | 0

Risposto
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 ...

quasi 12 anni fa | 0

Risposto
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 ...

quasi 12 anni fa | 3

| accettato

Risposto
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}); ...

quasi 12 anni fa | 0

| accettato

Risposto
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...

quasi 12 anni fa | 0

Risposto
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 ...

quasi 12 anni fa | 1

Risposto
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...

quasi 12 anni fa | 0

Risposto
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...

quasi 12 anni fa | 0

Risposto
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...

quasi 12 anni fa | 0

Risposto
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...

quasi 12 anni fa | 2

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

quasi 12 anni fa | 0

Risposto
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...

circa 12 anni fa | 0

Risposto
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...

circa 12 anni fa | 0

Risposto
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 ...

circa 12 anni fa | 0

Risposto
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...

circa 12 anni fa | 1

| accettato

Risposto
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.

circa 12 anni fa | 0

Risposto
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 ...

circa 12 anni fa | 0

Risposto
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...

circa 12 anni fa | 0

| accettato

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

circa 12 anni fa | 0

| accettato

Risposto
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.

circa 12 anni fa | 0

Risposto
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...

circa 12 anni fa | 0

Risposto
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 ...

circa 12 anni fa | 0

Carica altro