Index in position 1 is invalid. Array indices must be positive integers or logical values. Z=null(R,'r')

2 Ansichten (letzte 30 Tage)
I got a problem with this code. Appearently it works for my friends (even if i copy their assignment, that works, and paste it my computer still says that there is an error). Do any of you know how to fix this problem?
% Assignment 2.6
% An acidic aqueous solution contains Cr_2O_3, Cr^3+, Cr(H_2O)_6^3+,[Cr(H_2O)_5(OH)]^2+, H^+ and H_2O
% Determine the number of independent chemical reactions and use matrix algebra to suggest stoichiometric coeffcients for these reactions.
R=[2 1 1 1 0 0;3 0 6 6 0 1;0 0 12 11 1 2;0 3 3 2 1 0]
Z=null(R,'r')
  1 Kommentar
Bruno Luong
Bruno Luong am 10 Sep. 2019
Bearbeitet: Bruno Luong am 10 Sep. 2019
You overshadow MATLAB function NULL.
Type
which null
Check if it returns path of MATLAB stock function, something ike this
C:\Program Files\MATLAB\R2019a\toolbox\matlab\matfun\null.m

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

madhan ravi
madhan ravi am 10 Sep. 2019
Bearbeitet: madhan ravi am 10 Sep. 2019
This is the exact reason why people shouldn’t name variables as the names of inbuilt functions!!
clear null % to clear the variable named null in workspace

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by