Equation solution is not found for all array element
2 views (last 30 days)
Show older comments
Mustafa on 31 Mar 2023
Commented: Mustafa on 3 Apr 2023
Hi I have an equation that includes just one variable. With vpasolve command, it is just solved until 105th array value. But array length is 298x1. what is the wrong? and is there any suggestion? (my opinion is, when i equal to 106 and higher, program can't find real solution, but it should be)
clear all, clc, format shortG, close all
syms t_bulk Te n hw me t_p eps_inf eps_s w
And error is below: Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-1.
John D'Errico on 31 Mar 2023
Edited: John D'Errico on 31 Mar 2023
For SOME of these sub-problems, no solution was found.
I would suggest that when the result from vpasolve is empty, you could assign a NaN for those cases.
result = double(vpasolve(Ptheory1==Pexp(i,1),Te, 1));
T1(i,1) = NaN;
T1(i,1) = result;
More Answers (0)
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!