Answered

Stuck with electronic circuit simulation..

R = 1; L = 1; C = 1; % replace by your values w = 50; % replace by frequency Z = R+1j*w*L+1./(1j*w*C); % impedence of th...

Stuck with electronic circuit simulation..

R = 1; L = 1; C = 1; % replace by your values w = 50; % replace by frequency Z = R+1j*w*L+1./(1j*w*C); % impedence of th...

7 years ago | 2

| accepted

Answered

Generating row combination from a set of data

T = rand(37,25); fil = 1:37; b = combntns(fil,3); for k = 1:size(b,1) out(:,:,k) = T(b(k,:),:); end

Generating row combination from a set of data

T = rand(37,25); fil = 1:37; b = combntns(fil,3); for k = 1:size(b,1) out(:,:,k) = T(b(k,:),:); end

7 years ago | 1

Answered

Combination of the value of different vectors into one matrix ?

out = combvec(A,B,C)'

Combination of the value of different vectors into one matrix ?

out = combvec(A,B,C)'

7 years ago | 2

Answered

Generate an equation from a 3d surface

You can play a trick here. Use your code first: Eq = @(x,y) x.*y.*(y>=0 & y<3) + 2*x.*y.*(y>=3 & y<5) + 3*x.*y.*(y>=5 & y...

Generate an equation from a 3d surface

You can play a trick here. Use your code first: Eq = @(x,y) x.*y.*(y>=0 & y<3) + 2*x.*y.*(y>=3 & y<5) + 3*x.*y.*(y>=5 & y...

7 years ago | 0

Answered

Generate an equation from a 3d surface

In Matlab, you can compact the three equations into one as written below. It is not a theoretical modeling anyway, but simply a ...

Generate an equation from a 3d surface

In Matlab, you can compact the three equations into one as written below. It is not a theoretical modeling anyway, but simply a ...

7 years ago | 1

Answered

Summation equations in matlab

You can try with this: SOAM = sum(CP(1:n-3))/sum(abs(P(2:n)-P(1:n-1))) The 2nd sum is confusing because of the indexin...

Summation equations in matlab

You can try with this: SOAM = sum(CP(1:n-3))/sum(abs(P(2:n)-P(1:n-1))) The 2nd sum is confusing because of the indexin...

7 years ago | 2

| accepted

Answered

Regarding importing excel in matlab

xlsread import excel data with cell type. Convert them to double before plotting. In this case u can use cell2mat function: ...

Regarding importing excel in matlab

xlsread import excel data with cell type. Convert them to double before plotting. In this case u can use cell2mat function: ...

7 years ago | 1

| accepted

Answered

What is the problem in this code?

Your n has a length of 9, as n=0:8, so i will have length of 9 as well,and hence, you cannot write i(1:81). There are many ways ...

What is the problem in this code?

Your n has a length of 9, as n=0:8, so i will have length of 9 as well,and hence, you cannot write i(1:81). There are many ways ...

7 years ago | 1

| accepted

Answered

binary matrix that has different orders of 0 and 1

If the ordering of rows is not a concern, then use: n = 3; A = dec2bin(0:2^n-1); B = double(A)-48 Note: 48 is the ...

binary matrix that has different orders of 0 and 1

If the ordering of rows is not a concern, then use: n = 3; A = dec2bin(0:2^n-1); B = double(A)-48 Note: 48 is the ...

7 years ago | 2

Answered

create 3-dimension matrix

If you use your current code, then call your function create1() (from command window, or in another m-file): c = create1();...

create 3-dimension matrix

If you use your current code, then call your function create1() (from command window, or in another m-file): c = create1();...

7 years ago | 1

| accepted

Answered

problem in Hanning window with FFT

Here are few things: Your plot shows the amplitude of Fourier transform, not the original signal. So, the amplitude may not be ...

problem in Hanning window with FFT

Here are few things: Your plot shows the amplitude of Fourier transform, not the original signal. So, the amplitude may not be ...

7 years ago | 1

| accepted

Answered

How can I break line in comment for HTML publication?

%% Test section %% % After the break!

How can I break line in comment for HTML publication?

%% Test section %% % After the break!

7 years ago | 2

Answered

how can i plot using variables from a loop?

You can do this without using a for loop: er=2.2;h=0.1588; freq={11 2 3 4 5 6 7 8 9 10}; i=1:1:length(freq); ...

how can i plot using variables from a loop?

You can do this without using a for loop: er=2.2;h=0.1588; freq={11 2 3 4 5 6 7 8 9 10}; i=1:1:length(freq); ...

7 years ago | 1

Answered

Producing an error vector with a loop

Where is your LogLike_Error_Vector? Is it LogLike_DT_Data? If so, you can try using a for loop: indx = 0; for MinLeaf = ...

Producing an error vector with a loop

Where is your LogLike_Error_Vector? Is it LogLike_DT_Data? If so, you can try using a for loop: indx = 0; for MinLeaf = ...

7 years ago | 2

| accepted

Answered

I want to plot the auto correlation function for 15 numbers without using the inbuilt function. My series is P=[ 47,64,23,71,38,64,55,41,59,48,71,35,57,40,58 ] and the plot should be autocorrelation function vs lags.

Replace acf=covark/covar0 ; by *acf(k)=covark/covar0;* Also no need to use acf after that line. After the end of for loop,...

I want to plot the auto correlation function for 15 numbers without using the inbuilt function. My series is P=[ 47,64,23,71,38,64,55,41,59,48,71,35,57,40,58 ] and the plot should be autocorrelation function vs lags.

Replace acf=covark/covar0 ; by *acf(k)=covark/covar0;* Also no need to use acf after that line. After the end of for loop,...

7 years ago | 3

| accepted

Answered

How to separate signals with diffrent frequencies

Add the following lines of code at the bottom of your code (after y=x+randn(size(x)).*sigma;): ffty = fft(y); ffty = abs...

How to separate signals with diffrent frequencies

Add the following lines of code at the bottom of your code (after y=x+randn(size(x)).*sigma;): ffty = fft(y); ffty = abs...

7 years ago | 5

| accepted

Answered

Why am I getting imaginary values with ode45 ??

Your I has both negative and positive values, which are in the range of 10^(-7), but Is is in 10^(-12). So, I/Is gives high nega...

Why am I getting imaginary values with ode45 ??

Your I has both negative and positive values, which are in the range of 10^(-7), but Is is in 10^(-12). So, I/Is gives high nega...

7 years ago | 1

Answered

Summation of a series without for loop

Yes you can do this! Use vectorization technique. Try to understand the line F = ... in the following code. If you get any hard ...

Summation of a series without for loop

Yes you can do this! Use vectorization technique. Try to understand the line F = ... in the following code. If you get any hard ...

7 years ago | 3

| accepted

Answered

Rotation of 3d image

I am not sure what your aim is. You can try the following code: for az = -37.5:5:322.5 view(az,30) pause(0.1)...

Rotation of 3d image

I am not sure what your aim is. You can try the following code: for az = -37.5:5:322.5 view(az,30) pause(0.1)...

7 years ago | 1

| accepted

Answered

how can i solve this one below?!! PS: the most important to me is to know how to take the values from the user and put them into a matrix and please i want the simplest way for it

N = input('N='); for i = 1:N for j = 1:3 A(i,j) = input(['row ',num2str(i),' and column ',num2str(j),' elemen...

how can i solve this one below?!! PS: the most important to me is to know how to take the values from the user and put them into a matrix and please i want the simplest way for it

N = input('N='); for i = 1:N for j = 1:3 A(i,j) = input(['row ',num2str(i),' and column ',num2str(j),' elemen...

7 years ago | 1

Answered

How to do numerical multiple integral (more than triple) by using matlab?

You can eliminate the variables one by one until you feel comfortable. You can make down to 3 or 2 or 1 variable before final in...

How to do numerical multiple integral (more than triple) by using matlab?

You can eliminate the variables one by one until you feel comfortable. You can make down to 3 or 2 or 1 variable before final in...

7 years ago | 1

Answered

Matlab Triple Integration Error. Thank You

Replace out2 by out2 = integral3(yi, 0, Inf , 0, @(u3) u3 , 0, @(u3,u2) u2) If you want to use function handles as the ...

Matlab Triple Integration Error. Thank You

Replace out2 by out2 = integral3(yi, 0, Inf , 0, @(u3) u3 , 0, @(u3,u2) u2) If you want to use function handles as the ...

7 years ago | 1

| accepted

Answered

Randomly create lower and upper of matrix separately.

l = tril(rand(m,n),-1); % lower triangle u = triu(rand(m,n),1); % upper triangle d = diag(rand(1,m),0); % diagonal eleme...

Randomly create lower and upper of matrix separately.

l = tril(rand(m,n),-1); % lower triangle u = triu(rand(m,n),1); % upper triangle d = diag(rand(1,m),0); % diagonal eleme...

7 years ago | 2

| accepted

Answered

How to rotate cube in MATLAB.?

Add the following lines of code at the bottom of your code: roll = -0.3064; pitch = -1.2258; yaw = 9.8066; dcm = angle2d...

How to rotate cube in MATLAB.?

Add the following lines of code at the bottom of your code: roll = -0.3064; pitch = -1.2258; yaw = 9.8066; dcm = angle2d...

7 years ago | 2

| accepted

Answered

How can i change values for my data in plot axis?

Replace t in plot by t/3600, that converts t from second to hour Add a text command with appropriate coordinate of the locati...

How can i change values for my data in plot axis?

Replace t in plot by t/3600, that converts t from second to hour Add a text command with appropriate coordinate of the locati...

7 years ago | 2

| accepted

Answered

comparing matrix elements in order

A = [2000 500 300 300 1]'; A1 = sort(A,'descend'); if sum(A==A1)==length(A) disp('in order') else disp('not in...

comparing matrix elements in order

A = [2000 500 300 300 1]'; A1 = sort(A,'descend'); if sum(A==A1)==length(A) disp('in order') else disp('not in...

7 years ago | 2

| accepted

Answered

the number of occurences of each character of one string,in another

s = 'MEQNGLDHDSRSSIDTTINDTQKTFLEFRSYTQLSEKLASSSSYTAPPLNEDGPKGVASAVSQGSESVVSWTTLTHVYSILGAYGGPTCLYPTATYFLMGTSKGCVLIFNYNEHLQTILVP...

the number of occurences of each character of one string,in another

s = 'MEQNGLDHDSRSSIDTTINDTQKTFLEFRSYTQLSEKLASSSSYTAPPLNEDGPKGVASAVSQGSESVVSWTTLTHVYSILGAYGGPTCLYPTATYFLMGTSKGCVLIFNYNEHLQTILVP...

7 years ago | 1

Answered

Constructing an approximate periodical function x(t) giving its Fourier series coefficient?

You can use a vectorized code to get the periodic signal: f0 = 1; % set the frequency of desired signal t = 0:0.01:8; ...

Constructing an approximate periodical function x(t) giving its Fourier series coefficient?

You can use a vectorized code to get the periodic signal: f0 = 1; % set the frequency of desired signal t = 0:0.01:8; ...

7 years ago | 1

Answered

Confusion Matrix Results Issue

The input arguments of confusion, (in this case, outputs and predictedOutput) should be in range of [0 1]. So, instead of 100 an...

Confusion Matrix Results Issue

The input arguments of confusion, (in this case, outputs and predictedOutput) should be in range of [0 1]. So, instead of 100 an...

7 years ago | 1

| accepted

Answered

how to sparse represent a image?

Convert a to double first, and the use that in sparse. Make sure that a is not in 3D, if so, then make it 2D before using in spa...

how to sparse represent a image?

Convert a to double first, and the use that in sparse. Make sure that a is not in 3D, if so, then make it 2D before using in spa...

7 years ago | 2

| accepted