回答済み
Calculation of mortgage interest from the amount of the mortgage, annuity monthly installments and number of years
M = 100000; a = 8791.59; r = 1; syms x eqn = a == M*(x/1200*(1+x/1200)^(r*12))/((x/1200+1)^(r*12)-1) sol = solve(eqn, x); ...

8ヶ月 前 | 0

回答済み
How to deal with files in which rows have different numbers of columns
You could readcell but I wouldn't recommend it. I would suggest using textscan with appropriate format for what you are expecti...

8ヶ月 前 | 0

回答済み
Unable to perform assignment because the left and right sides have a different number of elements.
This version of the code does more work than is necessary, but has the minimal change needed to prevent the particular error you...

8ヶ月 前 | 0

回答済み
Split array into groups of close numbers
No -- because there is no rigourous meaning to what "close" means. For example, in [1 3 5 7], surely 1 is not "close" to 7, but...

8ヶ月 前 | 0

回答済み
Operator '>' is not supported for operands of type 'cell'.
filename = 'T.xlsx'; opt = detectImportOptions(filename); opt = setvaropts(opt, [2:6,13:15,18:19], 'Prefixes', "'", 'Suffixes'...

8ヶ月 前 | 0

| 採用済み

回答済み
Having multiple different bins in a histogram that don't overlap
Are you looking for bar with the 'stacked' option? Or are you looking for bar() with groups? Generally speaking, there are two...

8ヶ月 前 | 0

回答済み
Can we generate best fitted nonlinear equation between 4 inputs and 1 output, if we dont know the equation initially
No, you cannot. There are multiple constructive proofs that if you have a finite number of points known to finite precision, the...

8ヶ月 前 | 0

回答済み
Loading variables to a specifc workspace
How can i use the load command to load variables to a specific workspace MATLAB does not provide any way to do that. I would...

8ヶ月 前 | 0

回答済み
Please optimize this code by using a loop to display the polynomial coefficients.
fprintf('p%d=%.8f.\n', K, z(K+1)) However, you are using different widths for different coefficients. You will need to build a ...

8ヶ月 前 | 0

回答済み
FSOLVE requires all values returned by functions to be of data type double. showing while solving an algebraic equation in matlab ??
F and G are int() calls. Even if they evaluate to closed forms that were rational numbers, they have symbolic results. When you ...

8ヶ月 前 | 0

| 採用済み

回答済み
Why I cant plot drawn in MATLAB app designer
while(1) n = n + 1; c = (a+b)/2; if (fx(c)*fx(a) < 0) ...

8ヶ月 前 | 1

回答済み
kmeans with centroids from previous analysis
Yes, that looks good. I notice that you pass [] for the k value. That will probably not be immediately obvious to readers, but ...

8ヶ月 前 | 0

| 採用済み

回答済み
Using the output of one run of a function as the input of another iteration of that function
would it be possible to make such a function run faster by, for instance, not overwriting "List" on each iteration? No. When ...

8ヶ月 前 | 1

回答済み
converting float to integer makes problem
int64(y); That line takes a value of y as input, and creates a uint64 equivalent of the input value, and stores the value i...

8ヶ月 前 | 0

| 採用済み

回答済み
convert a cell (Rx1 cell) to a vector (Rx1 double)
13 entries in the cell are empty. rows_check_n = load("rows_check_n.mat"); rows_check_n = rows_check_n.rows_check_n; % 270x1...

8ヶ月 前 | 1

回答済み
problem after new license
In your workspace you have a variable named sqrt . You need to clear sqrt

8ヶ月 前 | 1

| 採用済み

回答済み
Caused by: MATLAB expression '<output of containers.Map>' is not numeric.
costToPlant=zeros(); costToPlant = containers.Map('KeyType', 'double', 'ValueType', 'double'); You initialize costToPlant as a...

8ヶ月 前 | 0

| 採用済み

回答済み
Problem opening a .hdf file
Functions to read HDF4 files are described at https://www.mathworks.com/help/matlab/hdf4.html

8ヶ月 前 | 0

回答済み
Results are not as expected ode15s
dxds= [((x(1)*((permH2O/z)*(ph*x(1)-pl*yH2O)+((permN2/z)*(ph*x(2)-pl*yN2))))+((permH2O/z)*(ph*x(1)-pl*yH2O)))/x(3); ((x(2)...

8ヶ月 前 | 1

回答済み
Is the Parallel Computing Performance sensitive to MATLAB Version?
parpool 'local' very likely used processes -- background thread pool had only just be introduced in R2021b. Here 'local' refers ...

8ヶ月 前 | 1

| 採用済み

回答済み
use particle swarm optimization algorithm to optimize the optimal transmission path from cluster heads selected by each round of cluster routing protocol to sink
You want to optiooize the optimal transmission path. First thing you need to do is decide what you want to optimize. It is the ...

8ヶ月 前 | 0

回答済み
I am attempting to code a function with a differential (temperature with respect to time) and i am unsure how to do so
You can pass T and to gradient() to get estimated derivative of . Multiply by , add Tj, result is . Transpose to get a column v...

8ヶ月 前 | 0

回答済み
Unrecognized function or variable
U0 = 0.5640; That is a numeric value. ft = fittype('a*exp(b*x)+c*exp(d*x)+(U0-a-c)*exp(f*x)+g','coeff',{'a','b','c','d','f','g...

8ヶ月 前 | 0

回答済み
Simulating a 2D Random Walk
Call simulateRandomWalk twice, once to get an x trajectory and once to get a y trajectory. Then put them together, plot(first_t...

8ヶ月 前 | 0

回答済み
Why is there a significant difference in the assignment results of functions using "subs" and "feval"
syms z load FF.mat Th3 z3 = 0.0016:0.00022:0.006; T1 = vpa(subs(Th3,z,z3)); disp(vpa(T1.',14)) Th3f = matlabFunction(Th3); ...

8ヶ月 前 | 0

回答済み
How to build a plot differential equations
n = 0;b=0; k = 1; a = 1; h = 0; p = 1; y(1)=0; y(2)=1; x=2; f=@(t,y)[y(2);y(2)+2.*n.*(1+a.*y(1).^3).*y(1)+k.^2.*(y(1)+b.*y(...

8ヶ月 前 | 0

回答済み
How can produce this matrix?
For the sum of each column to be 1, and the elements are each 0 or 1, then it follows that for every column, there must be exact...

8ヶ月 前 | 0

回答済み
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...

8ヶ月 前 | 0

| 採用済み

回答済み
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', @(...

8ヶ月 前 | 1

| 採用済み

回答済み
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 ...

8ヶ月 前 | 0

| 採用済み

さらに読み込む