How to find the unknown (value of 'a', which has more than 1 answers), if we already have known data from excel?
3 次查看(过去 30 天)
显示 更早的评论
Dear All,
Currently I have alot of data (in excel format from experimental measurement). I need to find an unknown from a equation, where the X and Y value of data to be included in the equation. I have run few codes, but could not find the unknown 'a' as error "Empty sym: 0-by-1" keep pop up once I troed to solve the equation.
Below are the is the:
1) Example of data:
![Data.GIF](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210638/Data.gif)
2) Details and equation used:
load Data.txt
syms a % unknown 'a'
d = 700e-6
rad = d./2
t = 1000e-6
c = 345.2
n = 1.83e-5
den = 1.189
X = Data(:,1)% X data from excel
w = 2*pi*X
D = 0.0042
p = 0.00615
k = rad*sqrt((w*den)/n)
Z1 = (((32*n*t)/(d.^2))*(1+(k.^2)/32).^(1/2))
z = Z1/(p*den*c)
Rs = (1/2)*(sqrt(2*n*den*w))
Y = Data(:,2) % Y data from excel
eqns = z + ((2*a*Rs)/(p*den*c)) == Y %Answer of the eqns is equal to Y values
solv = solve (eqns,a)
plot (X,a)
Above is the latest code I have run. Supposedly, my expectation, I will get 5 different values of 'a' and at the end I will plot graph X versus a to proceed to the next step.
Anyone can give and advice why this problem happens, do I have correct my code.
Any help will be appreciated.
Thank you.
Regards,
Nur Arafah
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!