error out of bond in xlabel

3 Ansichten (letzte 30 Tage)
Mohammad Umair
Mohammad Umair am 15 Sep. 2021
Beantwortet: Steven Lord am 9 Okt. 2024
plot(p,Tcurrent)
xlabel('length of rod')
ylabel('temperature')
  1 Kommentar
KSSV
KSSV am 15 Sep. 2021
What exactly is your question?

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Amith
Amith am 9 Okt. 2024
Hi Mohammad,
Hope this helps!

Steven Lord
Steven Lord am 9 Okt. 2024
If this is the error you receive:
xlabel = 42;
xlabel('length of rod')
Index exceeds the number of array elements. Index must not exceed 1.

xlabel appears to be both a function and a variable. If this is unintentional, use 'clear xlabel' to remove the variable 'xlabel' from the workspace.
likely the cause is that you've defined a variable named xlabel (as I did on the first line of the code above) and then tried to call the xlabel function. Rename the variable and make sure that the variable with that name has been cleared from memory and try again.

Community Treasure Hunt

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

Start Hunting!

Translated by