Excel Data in Matlab

조회 수: 2 (최근 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에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by