Error that X is used but not initalized.
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
My super simply Live script code
"
syms I
O(I)=14.6*10^(-3)*I
"
Output:
Warning: Uninitialized variable 'x' is used.
Bruh, i dont have an X in sight..... Maple>>matlab
0 commentaires
Réponses (2)
Sibghat
le 4 Mar 2024
One possible explanation to the error message could be that MATLAB is interpreting 'I' as 'x'. You don't need to define O(I) as you would in a symbolic math toolbox. Instead, you can define O as a function of I.
syms I
O(I) = 14.6 * 10^(-3) * I
O = 14.6 * 10^(-3) * I
PS: I read somewhere that MATLAB interprets undefined variable as 'x' by default in symbolic expressions. So, perhaps when you're defining O(I), MATLAB interprets it as O(x). However, I'd need to confirm that to be certain...
0 commentaires
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!