importing the excel data into matlab in symbolic math tool
Afficher commentaires plus anciens
i have used symbolic math tool box to find out the variable in the equation. i have imported the data from the excel file to matlab.but i am not getting the result.

Réponses (2)
Walter Roberson
le 15 Jan 2021
0 votes
Your X is a vector with four elements. When you use it in the equations you are creating a system of four simultaneous equations. You then ask solve to find a single N value that solves all of the equations simultaneously.
solve() is not vectorized: it is simultaneous solutions only.
9 commentaires
sunitha
le 15 Jan 2021
Walter Roberson
le 15 Jan 2021
Modifié(e) : Walter Roberson
le 15 Jan 2021
loop so that you only work with one set of data at a time.
Sometimes what you want is not one solution for each set of data. Sometimes what you want is a single solution that fits the data the best. In such a case you can use curve fitting or nonlinear least squares to try to find the best fit. You would want to use matlabFunction to generate the functions that be the model to fit against.
sunitha
le 15 Jan 2021
Walter Roberson
le 15 Jan 2021
Paste your existing code and I will show you the revised version. I do not want to have to type in your code from the picture of the code. I cannot run pictures of code.
sunitha
le 15 Jan 2021
Walter Roberson
le 15 Jan 2021
syms N
Qo = xlsread('suspended','Sheet1','A2:A5')
R = xlsread('suspended','Sheet1','B2:B5')
No = xlsread('suspended','Sheet1','C2:C5')
X = xlsread('suspended','Sheet1','F2:F5')
r = (No-N)./No;
V = 2435;
k = 1.076;
a = 0.27;
nX = size(X,1);
solutions = cell(nX,1);
for S = 1 : nX
solutions{S} = solve(Qo(S) .* (1+R(S)) .* (No(S)-N) .* r(S) - V*((X(S)*k*N)./(a+N)), N);
vpa(solution{S})
end
celldisp(solutions)
I used a cell array instead of a plain array because I did not want to assume that there would always be exactly one solution -- the code assumes that there might possibly be no solution, or multiple solutions.
sunitha
le 15 Jan 2021
sunitha
le 16 Jan 2021
Walter Roberson
le 16 Jan 2021
We do not have your data to test with. We also do not know what your manual calculations came out as.
sunitha
le 16 Jan 2021
Catégories
En savoir plus sur Data Import from MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!