答案很簡單:將「無用」的數據與值楠因爲MATLAB不繪製是男的數據值。
將nan值插入到矩陣的另一半應該有所訣竅。看下面的例子 - 它很笨重,但應該給出這個想法。我選擇了乘以楠,我如圖所示,但有六十個其他東西想到了。
% Create random data for illustration
data = tril(rand(50));
% I chose to divide by a lower triangular ones matrix (zeros above the
% diagonal) to get nan above the diagonal and ones below
nan_above_diag_ones_below = 1./tril(ones(50,50));
% Plot data with and without hiding the "useless part"
figure,
subplot(1,2,1), mesh(data), title('"useless" part shown')
subplot(1,2,2), mesh(data.*nan_above_diag_ones_below),
title('"useless" part hidden')
你真的沒有給我們足夠的信息來幫助你。你目前使用哪些代碼來繪製矩陣?你有一個結果應該是什麼樣子的樣本圖像? – gnovice 2011-12-24 17:44:02
經過三個多星期的爭論,我現在已經弄清楚了。如果將NaN值分配給矩陣中不需要的部分,它將不會顯示在圖上!我希望這個簡單的解決方案是由MATLAB人員或可能在網上找到... – 2011-12-25 14:45:33