Matlab 显示冲浪的实际大小?

Matlab 显示冲浪的实际大小?,matlab,matlab-figure,Matlab,Matlab Figure,是否有办法以实际大小和纵横比显示冲浪?我一直在网上搜索,但找不到任何有效的东西。我对MATLAB也很陌生 这是我的密码: rpos1 = 0; % image row vector pos counter rpos2 = 0; % existing image vector pos counter rpos3 = 0; % avg vector pos counter prompt = {'Image location:','Lowest image #:','Highest image #:

是否有办法以实际大小和纵横比显示冲浪?我一直在网上搜索,但找不到任何有效的东西。我对MATLAB也很陌生

这是我的密码:

rpos1 = 0;  % image row vector pos counter
rpos2 = 0; % existing image vector pos counter
rpos3 = 0; % avg vector pos counter
prompt = {'Image location:','Lowest image #:','Highest image #:','Row of interest:','Background noise reduction:'};
dlg_title = 'Input';
num_lines = 1;
def = {'C:\Users\Moz\Desktop\Hyperspecdata\images','300','390','700','100'};
answer = inputdlg(prompt,dlg_title,num_lines,def);
directory = (answer{1}); 
x1 = str2num(answer{2});
x2 = x1;
y1 = str2num(answer{3});
y2 = y1-1;
z = str2num(answer{4});
v = str2num(answer{5});
 finalslice = zeros(1,1312); % create matrix (imagecount x 1312)

%INSERT SLICES WITH 1 GAP%
for k = x1 : y1 
    baseFileName = sprintf('image0000000%03d.pgm',k);
    fullFileName = fullfile(directory, baseFileName); %fullfile(folder, baseFileName);
    A = imread(fullFileName);
    A = floor(A./16); % transform back to 12 bit
    B = A-v; % remove background noise 
    rpos1 = rpos1+1; % jump to next row
    thisline = B(z,:); % desired row in images
    finalslice(rpos1,:) = thisline; % add row vector
    rpos1 = rpos1+1; % jump to next row
    emptyline = zeros(1,1312); % create empty row vector
    finalslice(rpos1,:) = emptyline; % insert empty row vector
end

%INSERT AVERAGES INTO GAPS%
for k = x2 : y2 
    rpos2 = rpos2+1; % find first existing vector
    line1 = finalslice(rpos2,:); 
    rpos2 = rpos2+2; % find second existing vector
    line2 = finalslice(rpos2,:);
    avgline1 = (line1 + line2)/2; % average both
    rpos3 = rpos3+2;
    finalslice(rpos3,:) = avgline1; % insert average vector
    rpos2 = rpos2-1; % jump back to second existing vector
end

figure(1)
h = surf(finalslice,'EdgeColor','none','LineStyle','none','FaceLighting','phong');
colormap('jet');
view(2)

我正在加载一组图像,在特定点拍摄切片,然后将它们缝合在一起。输出不显示实际大小和纵横比。

已解决:

添加了
daspect()


你期望的结果是什么?你得到了什么?我期望的是182x1312的输出,但得到的是一个拉伸的输出。它没有显示它的实际大小。我想看一个182x1312曲面绘图的?实际尺寸?你是说轴相等吗?或
轴vis3d
?没有“实际尺寸”。“冲浪”是一个虚拟的3d对象,由抽象坐标描述,没有单位。请更准确地解释你想要实现的目标。而且,虽然包含代码通常是好的,但您的代码非常长,无法解释,难以理解,并且无法由您的问题的读者运行。为了得到一个好的答案,你需要发布一个好问题:对不起,我没有正确地解释这个问题。我在找
daspect()
。解决了问题。
o = max(max(finalslice)); 
[m n] = size(finalslice); 
figure(1) h = surf(finalslice,'EdgeColor','none','LineStyle','none','FaceLighting','phong'); colormap('jet'); 
view(2) 
daspect([m n o]);