想计算y在区间9-1​0上的最大幅值,有大​佬会改一下么。

조회 수: 1 (최근 30일)
bgyveng
bgyveng 2023년 5월 21일
답변: cgjsrey 2023년 5월 21일
clc
clear
a=[]
x=0:1:10
y=sin(x)
a=[a,(max(y(end-1:end,1))-min(y1(end-1:end,1)))/2]
a
%出错显示,下标索引必须为正整数类型或逻辑类型。

채택된 답변

cgjsrey
cgjsrey 2023년 5월 21일
仅供参考
clc
clear
a=[];
x=0:1:10;
y=sin(x);
a=[a,(max(y(1,end-1:end))-min(y(1,end-1:end)))/2]
a

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!