Re: [討論] 光譜for迴圈問題
※ 引述《malaydam ()》之銘言:
: 請問如何出現多組數據
: 如下例,應該出現四組spd,但執行只會出現一組
: 程式如下:
: function [wavelength_spd, spd]=spectrum(a,b)
: wavelength_spd=a(:,1);
: y1=a(:,2);
: y2=b(:,2);
: range1=max(y1)-min(y1);
: Ny1=(y1-min(y1))/range1;
: range2=max(y2)-min(y2);
: Ny2=(y2-min(y2))/range2;
spd=bsxfun(@times, ndgrid(1:2,1:2), [Ny1, Ny2])
顯示
Error using bsxfun
Non-singleton dimensions of the two input arrays must match each other.
有甚麼地方錯誤嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.248.184.184
※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1440600093.A.E6D.html
→
08/27 00:15, , 1F
08/27 00:15, 1F
→
08/27 00:36, , 2F
08/27 00:36, 2F
→
08/27 08:58, , 3F
08/27 08:58, 3F
討論串 (同標題文章)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章