Need urgent help in multivariate analysis

Hi, i need urgent help to validate this data. I'm trying to used meshgrid to plot but the figure is somehow kind of weird. please help..thanks.;
x1=[28.1000000000000;28.3100000000000;28.7700000000000;29.9200000000000;29.9800000000000;29.7300000000000;29.4500000000000;29.4500000000000;29.3000000000000;30.1900000000000;29.0300000000000;28.8300000000000];
x2=[15.9800000000000;2.93000000000000;0.930000000000000;1.46000000000000;3.89000000000000;2.57000000000000;5.66000000000000;9.92000000000000;8.57000000000000;4.45000000000000;37.9700000000000;34.3300000000000];
y=[28.2000000000000;29.0800000000000;30.5300000000000;32.2100000000000;32.3000000000000;32.1300000000000;31.4200000000000;31.4400000000000;31.0100000000000;31.4200000000000;29.3700000000000;28.6800000000000];
X = [ones(size(x1)) x1 x2 x1.*x2];
b = regress(y,X) % Removes NaN data
b =
-9.5805
1.3901
-1.3429
0.0449
>> [~,~,~,~,stats] = regress(y,X)
stats =
0.9269 33.8380 0.0001 0.2126
>> sin(X)
ans =
0.8415 0.1735 -0.2687 0.2082
0.8415 -0.0357 0.2100 0.9542
0.8415 -0.4756 0.8016 0.9986
0.8415 -0.9972 0.9939 -0.2947
0.8415 -0.9909 -0.6805 -0.3740
0.8415 -0.9934 0.5410 0.8457
0.8415 -0.9229 -0.5836 -0.1816
0.8415 -0.9229 -0.4752 0.0241
0.8415 -0.8551 0.7544 -0.2245
0.8415 -0.9411 -0.9658 0.6765
0.8415 -0.6858 0.2676 0.4168
0.8415 -0.5275 0.2256 -0.1318
>> y = sin(X);
X = linspace(0,0.5*pi);
>> y = X';
z = X .* exp(-X.^2 - y.^2);
surf(X,y,z)
>> xlabel('air temperature')
ylabel('total rainfall')
ylabel('total rainfall')
zlabel('water temperature')
view(50,10)

댓글 수: 1

What do you mean by weird? what is the exact question you have? Plot look ok.
And next time you might want to format your question correctly to help others understand your problem.
x1=[28.1000000000000;28.3100000000000;28.7700000000000;29.9200000000000;29.9800000000000;29.7300000000000;29.4500000000000;29.4500000000000;29.3000000000000;30.1900000000000;29.0300000000000;28.8300000000000];
x2=[15.9800000000000;2.93000000000000;0.930000000000000;1.46000000000000;3.89000000000000;2.57000000000000;5.66000000000000;9.92000000000000;8.57000000000000;4.45000000000000;37.9700000000000;34.3300000000000];
y=[28.2000000000000;29.0800000000000;30.5300000000000;32.2100000000000;32.3000000000000;32.1300000000000;31.4200000000000;31.4400000000000;31.0100000000000;31.4200000000000;29.3700000000000;28.6800000000000];
X = [ones(size(x1)) x1 x2 x1.*x2];
b = regress(y,X) % Removes NaN data
b = 4x1
-9.5805 1.3901 -1.3429 0.0449
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
[~,~,~,~,stats] = regress(y,X)
stats = 1x4
0.9269 33.8380 0.0001 0.2126
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
sin(X)
ans = 12x4
0.8415 0.1735 -0.2687 0.2082 0.8415 -0.0357 0.2100 0.9542 0.8415 -0.4756 0.8016 0.9986 0.8415 -0.9972 0.9939 -0.2947 0.8415 -0.9909 -0.6805 -0.3740 0.8415 -0.9934 0.5410 0.8457 0.8415 -0.9229 -0.5836 -0.1816 0.8415 -0.9229 -0.4752 0.0241 0.8415 -0.8551 0.7544 -0.2245 0.8415 -0.9411 -0.9658 0.6765
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
y = sin(X);
X = linspace(0,0.5*pi);
y = X';
z = X .* exp(-X.^2 - y.^2);
surf(X,y,z)
xlabel('air temperature')
ylabel('total rainfall')
ylabel('total rainfall')
zlabel('water temperature')
view(50,10)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Descriptive Statistics and Insights에 대해 자세히 알아보기

질문:

2024년 6월 21일

댓글:

2024년 6월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by