Re: [問題] 矩陣問題 已回收
clc;
clear;
close all;
% T 是輸入的值
T=[0.025,0.03,0.04,0.07,0.08];
for i=1:length(T)
% g是精所占
if T(i)<=0.025 && T(i)>0
g(i) = 1;
elseif T(i)<=0.04 && T(i)>=0.025
g(i) = (0.04-T(i))/(0.04-0.025);
else
g(i) = 0;
end
end
用矩陣跟迴圈就可以了 h,s 依樣畫葫蘆就好
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.234.249
推
11/01 18:42, , 1F
11/01 18:42, 1F
討論串 (同標題文章)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章