Borrar filtros
Borrar filtros

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

53 visualizaciones (últimos 30 días)
Fahad Ramzan
Fahad Ramzan el 12 de Abr. de 2021
Respondida: Cris LaPierre el 23 de Ag. de 2022
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];

Respuestas (1)

Cris LaPierre
Cris LaPierre el 23 de Ag. de 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.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by