Excel Data in Matlab

1 次查看(过去 30 天)
Maduka
Maduka 2022-12-18
评论: Maduka 2022-12-19
I want to replicate this graph of Grashof number at various velocity at different temperature, but I’m having challenge doing this on Matlab, please any assistance

采纳的回答

KSSV
KSSV 2022-12-18
Read about readtable. Using this import data from excel to MATLAB workspace and than use plot.
  6 个评论
Maduka
Maduka 2022-12-19
Gr = 5:5:25; % vectors are orthogonal, allowing implicit expansion to 2D t = (0.2:0.2:1).'; H = 1; n = 1; N = 5; Pr = 0.72; S = 0.2;
% pull out common terms B = Pr*(N-n);
% pull out term blocks % note that the terms of TB1 begin with an imbalanced (Pr*(N-n)^k, so it's unclear what that means % i'm going to assume that means (Pr*(N-n))^k, not Pr*(N-n)^k TB1 = t.^2/2 ... + B*(t.^4/24 - t.^2/4) ... + B^2*(t.^6/720 - t.^4/48 + 5*t.^2/48)... % 5*t^2/48 + B^3*(t.^8/40320 - t.^6/1440 + 5*t.^4/576 - 61*t.^2/1440) ... + B^4*(t.^10/36288000 - t.^8/80640 + 5*t.^6/17280 - 61*t.^4/17280 + 1385*t.^2/806400) - 1/2 ... + B*5/24 ... - B^2*61/720 ... + B^3*277/8064 ... - B^4*(0.014);
TB2 = t.^4/24 ... % + not + B.(t.^6/720 - t.^4/48) ... + B^2*(t.^8/40320 - t.^6/1440 + 5*t.^4/576)... + B^3*(t.^10/32688000 - t.^8/80640 + 5*t.^6/17280 - 61*t.^4/17280) ... + B^4*(t.^12/479001600 - t.^10/7257600 + 5*t.^8/967680 - 61*t.^6/518400 + 1385*t.^4/967680) - t.^2/4 ... + B*5*t.^2/48 ... - B^2*61*t.^2/1440 ... + B^3*277*t.^2/16128 ... - B^4*(7*t.^2/1000);
TB3 = 1/24 ... + B*(1/720 - 1/48) ... + B^2*(1/40320 - 1/1440 + 5/576) ... + B^3*(1/36288000 - 1/80640 + 5/17280 - 61/17280) ... + B^4*(1/479001600 - 1/7257600 + 5/967680 - 61/518400 + 1385/967680) - 1/4 ... + B*5/48 ... - B^2*61/1440 ... + B^3*277/16128 ... - B^4*7/100;
U = -Gr.*TB1 - (S + H - n)*Gr.*(TB2 - TB3); % elementwise multiply
% plot everything figure contourf(Gr,t,U) colorbar figure; hp = plot(t,U,'-d'); lstr = cell(numel(Gr),1); for k = 1:numel(Gr) lstr{k} = sprintf('Gr = %d',Gr(k)); end legend(hp,lstr,'location','southwest')
Now I’m trying to generate same curved graph with this code
Maduka
Maduka 2022-12-19
If it’s possible to plot without the code, using table values… I’ll appreciate

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Bar Plots 的更多信息

产品


版本

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by