Array indices must be positive integers or logical values.
Ältere Kommentare anzeigen
clear
close all
clc
t=[0:0.1:5];
M=2;
E=25;
B=(sin(M*pi.*t));
SC=E(1+exp(-t/4).*(sin(M*pi.*t)));
I'm trying to run this equations, but i'm getting an error that I don't understand.
Array indices must be positive integers or logical values.
Antworten (1)
Geoff Hayes
am 10 Apr. 2019
demoria - your E is a scalar (25) but you are treating it like an array at
SC=E(1+exp(-t/4).*(sin(M*pi.*t)));
and so the error message makes sense. Perhaps you need an operation (for example multiplication) here instead
SC = E * (1+exp(-t/4).*(sin(M*pi.*t)));
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!