Effacer les filtres
Effacer les filtres

Error R_tilde = builtin('s​ubsref',L_​tilde,Idx)​;

53 vues (au cours des 30 derniers jours)
Fahad Ramzan
Fahad Ramzan le 12 Avr 2021
clc;
clear all
syms x y F(y)
f(y)=(10./3).*((x).*(y.^(2./5)));
eqn=diff(F(y))==f(y);
cond = [y(0) == 4];
Array indices must be positive integers or logical values.

Error in indexing (line 1075)
R_tilde = builtin('subsref',L_tilde,Idx);
sol=vpa (dsolve(eqn,cond))
I am Receving these errors.
Subscript indices must either be real positive integers or logicals.
R_tilde = builtin('subsref',L_tilde,Idx);
cond = [y(0) == 4];

Réponses (1)

Cris LaPierre
Cris LaPierre le 23 Août 2022
The error is because y is a variable, not a function, so y(0) is being treated as an indexing operation. Since MATLAB uses 1-based indexing, it is returning an error. Perhaps you meant to write f(0) in your condition statement?
y=1:3;
% works
y(2)
ans = 2
% your error
y(0)
Array indices must be positive integers or logical values.

Community Treasure Hunt

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

Start Hunting!

Translated by