Answered

I have 2 error .Error using interp1>reshapeAndSortXandV (line 445) X and V must be of the same length. Error in interp1 (line 128) [X,V,orig_size_v] = reshapeAndSortXan

Please have a look at the documentation for the information how to use interp1 function correctly: https://www.mathworks.com/he...

I have 2 error .Error using interp1>reshapeAndSortXandV (line 445) X and V must be of the same length. Error in interp1 (line 128) [X,V,orig_size_v] = reshapeAndSortXan

Please have a look at the documentation for the information how to use interp1 function correctly: https://www.mathworks.com/he...

1 year ago | 0

Answered

how can i do a histogram ?

For the paricular case, I think bar function would be more appropriate. text = "In the realm of possibilities, actions speak l...

how can i do a histogram ?

For the paricular case, I think bar function would be more appropriate. text = "In the realm of possibilities, actions speak l...

1 year ago | 0

Answered

How to combine boxplots from Anova into subplots

Can the following example give you an ide how to solve the problem? clear;clc;close all; y1 = meshgrid(1:5); %rng default; ...

How to combine boxplots from Anova into subplots

Can the following example give you an ide how to solve the problem? clear;clc;close all; y1 = meshgrid(1:5); %rng default; ...

1 year ago | 0

| accepted

Question

Legend with geobubble function is not behaving as expected

Hello, I have very strange and unexpected behavior of showing legend when using geobubble function. I'm reading data from the ...

1 year ago | 0 answers | 0

Answered

Merging Date and time

I would also like to suggest a bit different approach: T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_f...

Merging Date and time

I would also like to suggest a bit different approach: T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_f...

1 year ago | 0

Answered

How to numerically solve system of equations and differential equations simultaneously?

Does this make sense to you (in your simple example)? syms A B C(t) eqn1 = diff(C,t) == 6*A; C_sol = dsolve(eqn1) eqn2 = A...

How to numerically solve system of equations and differential equations simultaneously?

Does this make sense to you (in your simple example)? syms A B C(t) eqn1 = diff(C,t) == 6*A; C_sol = dsolve(eqn1) eqn2 = A...

1 year ago | 1

| accepted

Answered

Convert MATLAB use of Probability Density Function (PDF) to Python

I have made a quick test using Matlab's built in function pdf and Python's stats.norm.pdf x = [-2 -1 0 1 2]; mu = 1; sigma = ...

Convert MATLAB use of Probability Density Function (PDF) to Python

I have made a quick test using Matlab's built in function pdf and Python's stats.norm.pdf x = [-2 -1 0 1 2]; mu = 1; sigma = ...

1 year ago | 0

Answered

Omega method to integrate sin function

You're getting the weird values for disp because of division with eps (very small number). This code will produce what you expe...

Omega method to integrate sin function

You're getting the weird values for disp because of division with eps (very small number). This code will produce what you expe...

1 year ago | 0

Answered

Scale/Normalize values in matrix between 10^-6 and 10^-5

Hello, this is a matter of a simple linear transformation y = m*x+n. if you want to normalize data in interval [a,b] to interv...

Scale/Normalize values in matrix between 10^-6 and 10^-5

Hello, this is a matter of a simple linear transformation y = m*x+n. if you want to normalize data in interval [a,b] to interv...

1 year ago | 0

| accepted

Answered

Cyclic Redundancy Check function

As far as I can see, crcreceive.m is missing a portion of code present in the FullCode divisor = bitshift(divisor,messageLength...

Cyclic Redundancy Check function

As far as I can see, crcreceive.m is missing a portion of code present in the FullCode divisor = bitshift(divisor,messageLength...

1 year ago | 0

| accepted

Answered

Creating a cosine oscillation ( cos(2 * pi * f * k * T) )

Hi Ahmad, you can can think of k*T as a time vector, one example is: k = 1:2000; T = 1/Fs; tf = k*T; y = A*cos(2*pi*f*k*T); ...

Creating a cosine oscillation ( cos(2 * pi * f * k * T) )

Hi Ahmad, you can can think of k*T as a time vector, one example is: k = 1:2000; T = 1/Fs; tf = k*T; y = A*cos(2*pi*f*k*T); ...

1 year ago | 0

| accepted

Answered

Hello, why Matlab does not check for second condition and give an answer without checking second condition after AND short circuit operator?

Hi Aknur, in the example below, the part after && is evaluated. BTW, operators || and && are so called short-circuit operators...

Hello, why Matlab does not check for second condition and give an answer without checking second condition after AND short circuit operator?

Hi Aknur, in the example below, the part after && is evaluated. BTW, operators || and && are so called short-circuit operators...

1 year ago | 0

| accepted

Answered

what is r. in the pagerank algorithm

Hi Kellie, you probably mean on the following equation: r = (1-P)/n + P*(A'*(r./d) + s/n); % r is a vector of PageRank scores...

what is r. in the pagerank algorithm

Hi Kellie, you probably mean on the following equation: r = (1-P)/n + P*(A'*(r./d) + s/n); % r is a vector of PageRank scores...

1 year ago | 0

Answered

Why do we get different results here?

@Sadiq Akbar I'm puzzled too. In general, the results are not correct event sometimes are. For example, the result is wrong for...

Why do we get different results here?

@Sadiq Akbar I'm puzzled too. In general, the results are not correct event sometimes are. For example, the result is wrong for...

1 year ago | 0

Answered

How to express this equation to convert y values to a new vector and plot as a function of x?

websave('test.xlsx','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1321170/test.xlsx'); data = xlsread('test...

How to express this equation to convert y values to a new vector and plot as a function of x?

websave('test.xlsx','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1321170/test.xlsx'); data = xlsread('test...

1 year ago | 0

Answered

Solving for Variables contained an interval

fun = @(x) (sin(x) .* (2.* cos(x) - 1)) ./ (1 + 2 .* cos(x)); % function x0 = [0.1 2]; % initial interval x = fzero(fun,x0) ...

Solving for Variables contained an interval

fun = @(x) (sin(x) .* (2.* cos(x) - 1)) ./ (1 + 2 .* cos(x)); % function x0 = [0.1 2]; % initial interval x = fzero(fun,x0) ...

1 year ago | 1

Answered

Why do we get different results here?

Can you try with the following ByAskic.m function: function e = ByAskic(b,u) % u = [10 20 30 40];b = u; N = 10;%6; % Tx anten...

Why do we get different results here?

Can you try with the following ByAskic.m function: function e = ByAskic(b,u) % u = [10 20 30 40];b = u; N = 10;%6; % Tx anten...

1 year ago | 0

Answered

MATLAB Newton Raphson method with array - Stephan problem

Is this what you wanted to achieve? clear clc close all a0 = -0.00401; a1 = 1.18669; a2 = -0.14559; a3 = -0.33443; a4 = ...

MATLAB Newton Raphson method with array - Stephan problem

Is this what you wanted to achieve? clear clc close all a0 = -0.00401; a1 = 1.18669; a2 = -0.14559; a3 = -0.33443; a4 = ...

1 year ago | 0

| accepted

Answered

How to compute the AUC (Area Under Curve)?

I think this would be a correct way to do so, but I'm not 100% sure. It seems correct from the ROC diagrams: [x,t] = iris_datas...

How to compute the AUC (Area Under Curve)?

I think this would be a correct way to do so, but I'm not 100% sure. It seems correct from the ROC diagrams: [x,t] = iris_datas...

1 year ago | 1

| accepted

Answered

How to use rlocfind in root locus.

You could start with this: help tf help rlocfind Additional comments from Siddharth Jawahar at MathWorks 0n 6/18/2024: Suppo...

How to use rlocfind in root locus.

You could start with this: help tf help rlocfind Additional comments from Siddharth Jawahar at MathWorks 0n 6/18/2024: Suppo...

1 year ago | 0

| accepted

Answered

How do I preallocate for speed in the following code?

The most basic approach is given here: clc clear N = 9; S = 18.1; AR = 7; lambda = 0.8; ...

How do I preallocate for speed in the following code?

The most basic approach is given here: clc clear N = 9; S = 18.1; AR = 7; lambda = 0.8; ...

1 year ago | 0

Answered

What is the difference between Step size and Sample Time ?

According to Matlab's documentation, The sample time of a block is a parameter that indicates when, during simulation, the bloc...

What is the difference between Step size and Sample Time ?

According to Matlab's documentation, The sample time of a block is a parameter that indicates when, during simulation, the bloc...

1 year ago | 0

| accepted

Answered

Is it possible numerical problem ?

This is called a round-off error caused by floating point arithmetic. Please read this (it is for Python, but equally applicabl...

Is it possible numerical problem ?

This is called a round-off error caused by floating point arithmetic. Please read this (it is for Python, but equally applicabl...

1 year ago | 0

Answered

ploting electric field versud time

This is how can you read the contents of the file into variables. data_file = websave('phi_theta.txt','https://www.mathworks.co...

ploting electric field versud time

This is how can you read the contents of the file into variables. data_file = websave('phi_theta.txt','https://www.mathworks.co...

1 year ago | 0

Answered

Integral of matrix determinant

I would do it symbolically: syms x f = det([1,x;0,2]); Q = int(f,0,1)

Integral of matrix determinant

I would do it symbolically: syms x f = det([1,x;0,2]); Q = int(f,0,1)

1 year ago | 0

Answered

create a shuffleable datastore

A different approach would be to read csv file in a table and create datastore from the table. this datastore issubsetable and ...

create a shuffleable datastore

A different approach would be to read csv file in a table and create datastore from the table. this datastore issubsetable and ...

1 year ago | 0

| accepted

Answered

Absurd result using 'integral2' with non-"centered" functions

@Torsten already answered, please keep in mind that integral2 still performs numerical integration. have a look at this: clear...

Absurd result using 'integral2' with non-"centered" functions

@Torsten already answered, please keep in mind that integral2 still performs numerical integration. have a look at this: clear...

1 year ago | 1

Answered

Converting string to integer - indexing and multiple trials

If you look into your data in Matlab, you will see that CodeTimes is actually an array of doubles and not strings: cc = load (w...

Converting string to integer - indexing and multiple trials

If you look into your data in Matlab, you will see that CodeTimes is actually an array of doubles and not strings: cc = load (w...

1 year ago | 0

| accepted

Answered

How do I properly use the "while", "for", "loop" command in this problem?

A = [71.213; 74.499; 79.175; 54.163; 83.008; 52.615]; B = length(A); %size of column (number of elements) %H = A(i); %Variable...

How do I properly use the "while", "for", "loop" command in this problem?

A = [71.213; 74.499; 79.175; 54.163; 83.008; 52.615]; B = length(A); %size of column (number of elements) %H = A(i); %Variable...

1 year ago | 0

Answered

Legends in Bode plots do not support subscripts

g1=tf([1 0],[5 1]); bode(g1) title('\Gamma_h vs \omega') h = legend('$\Gamma\_h$','fontsize', 12); set(h, 'Interpreter', '...

Legends in Bode plots do not support subscripts

g1=tf([1 0],[5 1]); bode(g1) title('\Gamma_h vs \omega') h = legend('$\Gamma\_h$','fontsize', 12); set(h, 'Interpreter', '...

1 year ago | 0