I'm trying to solve for a set of values ([0,6]) for my squared function, but it only returns an error about "subscript indices must either be real positive integers or logicals" Here is my code :
clear;
clc;
t=[0:6];
k=0.4;
NO2(t) = (0.5./(1+(0.5)*(k)*t));
NO2_Squared(t) =(NO2(t)).^2

 채택된 답변

James Tursa
James Tursa 2017년 10월 12일
편집: James Tursa 2017년 10월 12일

0 개 추천

You are using t as a subscript in these lines, and one of the t values is 0:
NO2(t) = (0.5./(1+(0.5)*(k)*t));
NO2_Squared(t) =(NO2(t)).^2
Simply drop those subscripts:
NO2 = (0.5./(1+(0.5)*(k)*t));
NO2_Squared =(NO2).^2;

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Aerospace Blockset에 대해 자세히 알아보기

질문:

2017년 10월 12일

편집:

2017년 10월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by