MATLAB Answers

Why am I getting this error message?

1 view (last 30 days)
Noah Wilson
Noah Wilson on 18 Jul 2018
Edited: Noah Wilson on 18 Jul 2018
function [STD] = STD(T4, T7, H2O, Temp4, Temp7, H2Onumb, HC)
s4 = (T4/Temp4)^2; %std of T4 divided by the mean of T4
s7 = (T7/Temp7)^2; %std of T7 divided by the mean of T7
sH2O = (H2O/H2Onumb)^2; %std of H2O divided by the mean of H2O
STD = HC*(sqrt(s4+s7+sH2O)); %Standard Deviation of Heat Capacity value
Not sure why the error came up. It worked once but then this error message pops up after every attempt.


Sign in to comment.

Accepted Answer

James Tursa
James Tursa on 18 Jul 2018
Don't post images of code. This makes it impossible for readers to copy & paste your code for testing. Instead, post the actual text of the code & error messages etc and then highlight this text and press the { } Code button to format it.
You have a function named STD and a variable named STD. These conflict with each other. As soon as you define the variable STD in the workspace, it shadows the function. Choose a different name for the variable.


Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by