Answered
i got this error "Index exceeds the number of array elements (1)." at the first line starting " U(j, n + 1, dt_index)" when the first loop completed for one time
for dt_index = 1:length(dt_values) dt = dt_values(dt_index); Nt = Nt_values(dt_index); You extract particular s...

2 years ago | 0

| accepted

Answered
How to get every term of a sum thats not multiplied by a convergent exponential function?
Not exactly what you asked, but syms t G = exp(-t)*cos(t) + 3*exp(-2*t)*sin(2*t) + 1/2*cos(4*t) + 1/5 mapSymType(G, 'exp', @(...

2 years ago | 1

| accepted

Answered
convert the table to matrix
N = 1500; %we proceed in two steps. %we read one array for k = 1 myfilename = sprintf('Vec%05d.dat', k); mydata1 ...

2 years ago | 0

| accepted

Answered
how can i make int24 data type conversions??
No, simulink cannot handle an int24 datatype. The closest it could handle would be a Fixed-Point datatype see fi You could, o...

2 years ago | 0

| accepted

Answered
semilog plot with a self defined x-axis range
T = readtable('data.xlsx', 'VariableNamingRule', 'preserve'); whos T T.Properties.VariableNames plot(T, "return period (year)...

2 years ago | 1

Answered
Solve a function and plot its contour plot. Not getting the desired contour plot?
%h was not defined in original code -- make sure you assign a meaningful %value! h = 1; syms X Y Z real Q = @(v) sym(v);...

2 years ago | 1

| accepted

Answered
Speed of the abs function
We have to watch out for measurement error due to Execution Engine processing format long g N = 10000; x = randn(N, 1); y = r...

2 years ago | 0

Answered
converging criteria problem in for loop in bisection method of finding roots.
x = (xlo+xuo)./2; % 1st approximation for finding root x is a scalar at that point -- so x(1) is the only defined element. for...

2 years ago | 0

Answered
Indexing error while using symsum inside a function.
y = [2 -1 3 -2 4 -3 2 -4 1 -2] Your y is a numeric vector. Test(x,y) you are passing that numeric vector as the second parame...

2 years ago | 0

| accepted

Answered
problem with fprintf command
close all clear all y = @(x) x.^3-x-11; x = -10:1:10; f = y(x); fprintf('%8s %8s\n','x','f') disp(char(compose("%8.2f ...

2 years ago | 0

| accepted

Answered
How to convert values of 0 to NaN
Leave them the way they are now, but set the axes color to white. Tell imagesc() tol make NaN values transparent, so those locat...

2 years ago | 0

Answered
Index in position 1 exceeds array bounds. Index must not exceed 1.
V = [1.05, 1.05, 1.05, 1.05, 1.05, 1.05]; % Initial guess Row vector. V(i) = (1/Y(i, i)) * (conj( S(i) / V(i) ) - Y(i,...

2 years ago | 0

Answered
Grid_style plot
( it only shows var1:var19 but i want the actual names on the plot) That is what it is plotting. 387×19 table ...

2 years ago | 0

Answered
Is Conv2 based on direct convolution?
Historically, MATLAB implemented several different cases according to size and data type (and matters such as complex-valued or ...

2 years ago | 2

Answered
My function to read data from three csv files is only reading one file and storing it in 'ans' instead of the variable K.
[K, K_sub, Q] = inputData(); You have to store the outputs into variables. When you invoke a matlab Function with named output...

2 years ago | 0

Answered
How to pass a variable with latex interpreter in the legend?
lgd = legend(["$M>3$", "$\tau = $ " + r_Fit], 'interpreter', 'latex'); This will convert r_Fit according to internal (and seemi...

2 years ago | 1

| accepted

Answered
Why am I receiving the error?
DuDx is 4 x 1. It is used to calculate s3, so s3 is 4 x 1. s3 is used as the third component of s, so s ends up length 1 + 1 + 3...

2 years ago | 0

| accepted

Answered
Can someone explain why my graph is not generating any lines. I copied my code from this video https://www.youtube.com/watch?v=vaMiCkrRC6Q
clear clf %All Constants Used G = 6.67408e-11; M = 5.9722e24; m = 1000; %Changing Variables r = [6.67e6, 0 , 0]; %Radius...

2 years ago | 0

Answered
Finding real and imaginary part of an equation
You extracted the real part into a variable but you plot() the complex variable. syms U P P = sqrt((((20*U^2) -15) + sqrt((400...

2 years ago | 0

Answered
How to convert a differential equation str to a equation for dsolve to work with
So there is no way of doing this with a textfield? No, there is not. The problem is not the uitextarea or uieditfield: the prob...

2 years ago | 2

Answered
How can I stop App Designer UITable from displaying all numbers as complex?
Only if you convert all of the entries to string or characters Formatting on a uitable is strange. For example if you have fo...

2 years ago | 1

| accepted

Answered
Can Genetic Algorithm in MATLAB Return a 3D Matrix as an Optimal Solution?
No. If you call ga directly then the function must expect a vector and must return a vector. You can reshape() first thing you d...

2 years ago | 1

Answered
How to count number of terms in a symbolic expression?
syms x y z=x*y+cos(x*y)*x+x*sin(x)+sin(x)*cos(x)-x-y+2; terms = children(z) nterms = length(terms) terms{3} children(z, 3)

2 years ago | 1

| accepted

Answered
How is the Riemann-Liouville fractional order integral code in MATLAB?
syms alpha t s real syms f(s) Iaf(t) = 1/gamma(alpha) * int((t-s)^(alpha-1) * f, s, 0, t) %example subs(Iaf, {f}, {sin(s)}...

2 years ago | 0

Answered
How do I open .bin file and transform data to .txt file
You might be able to take advantage of multibandread

2 years ago | 0

Answered
Getting "not a valid name" error
mdl = 'WaterTank' ; Leave out the extension in that context

2 years ago | 0

| accepted

Answered
error is not showing but plot is not generating
The Jacobian is singular if y(4) = dv/dx = 0, which it is because of your boundary conditions. That said, even if I change the ...

2 years ago | 0

Answered
How can I send data from a GUI Window to a table in another GUI Window in AppDesigner?
Create a uifigure(). Create a uitable() within the uifigure. Set the Data of the uitable to be a table() containing the values y...

2 years ago | 0

Answered
For loop function help
You are not displaying any results, and you are overwriting all of a each iteration. syms t x; x_t = (t.^2)/(t-1); y_t = (t...

2 years ago | 0

Answered
I want a trial version of whatever will allow me to use smithplot on R2009b. If not I need to purchase the toolbox.
smithplot was introduced in R2017b as part of the RF Toolbox. You would therefore need a trial of MATLAB R2023b and RF Toolbox...

2 years ago | 0

Load more