필터 지우기
필터 지우기

surf plot is only showing grid (not surface)

조회 수: 2 (최근 30일)
coconutMocha
coconutMocha 2016년 6월 22일
답변: Walter Roberson 2016년 6월 22일
I'm using the following code, but not getting a surface plot (rather, only the wiring underneath). Do you know why this might be? Thanks in advance for your help.
rotation = RotationToRotationStructure_Data(:,1);
exactK = ScalingToRotationStructure_Data(:,1);
scale_tx = ScalingToRotationStructure_Data(:,2);
scale_ty = ScalingToRotationStructure_Data(:,3);
rot_tx = RotationToRotationStructure_Data(:,2);
rot_ty = RotationToRotationStructure_Data(:,3);
scale_ReportX = ScalingToRotationStructure_Data(:,4);
scale_ReportY = ScalingToRotationStructure_Data(:,5);
rot_ReportX = RotationToRotationStructure_Data(:,4);
rot_ReportY = RotationToRotationStructure_Data(:,5);
nUniquePert = numel(unique(exactK(1:240,1)));
%expected values
thetaHat = zeros(2400,1);
rot_scaleHat = thetaHat;
for j = 1:length(thetaHat);
scale_expected_ReportX(j) = exactK(j)*scale_tx(j) + ...
exactK(j)*scale_ty(j);
scale_expected_ReportY(j) = -exactK(j)*scale_tx(j) + ...
exactK(j)*scale_ty(j);
rot_expected_ReportX(j) = 1*cos(rotation(j))*rot_tx(j) + ...
1*sin(rotation(j))*rot_ty(j);
rot_expected_ReportY(j) = -1*sin(rotation(j))*rot_tx(j) + ...
1*cos(rotation(j))*rot_ty(j);
scale_goodfit(j) = rmse(scale_expected_ReportX(j) - scale_ReportX(j), scale_expected_ReportY(j) - scale_ReportY(j));
rot_goodfit(j) = rmse(rot_expected_ReportX(j) - rot_ReportX(j), rot_expected_ReportY(j) - rot_ReportY(j));
end
x = repmat(thetaHat, 1, 2); y = repmat(exactK, 1, 2);
z = repmat(scale_goodfit',1,2);
colormap hsv;
h = surf(x, y, z);
  댓글 수: 5
coconutMocha
coconutMocha 2016년 6월 22일
It's a 2400x7 matrix consisting of experiment variables which change every 8 elements.
KSSV
KSSV 2016년 6월 22일
Data is needed to plot and debug buddy...

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

채택된 답변

Walter Roberson
Walter Roberson 2016년 6월 22일
You effectively do not have a surface. Your x is completely 0, and your y appears to be unsorted.
If you truly want an x that is all zero, then I suggest you sort exactK and save it and the sorting order, and also use that sorting order to sort scale_goodfit before constructing your z. surf() the sorted exactK and the corresponding constructed z.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by