MATLAB: Defining a variable in matlab plotvariable V = ((pi*h^2)/3)*((3*r)-h) plot(h,V) ??? Undefined function or variable 'h'. Error in ==> p5_22 at 6 V = ((pi*h^2)/3)*((3*r)-h) I'm sure this is very simple but i forgot how to tell matlab that 'h' is a variable Best Answer hi there, you can use this oneh = 1:1:10 (create variable h from 1 to 10) Related SolutionsMATLAB: How do i convert V=pi*h^2*[3R-h]/3 equation into a function. I have V and R and need to find h "How do i convert V=pi*h^2*[3R-h]/3 equation into a function. I have V and R and need to find h"V=4;R=3;h = height(V,R) %function callfunction h = height(V,R) %function definition just create a functin with V and R as inputsyms h h=vpasolve(V==pi*h^2*3*(R-h)/3,h);end MATLAB: Saving with quotes. Hint>> grunk = '''WOW'''grunk ='WOW'Depending on what you want, you could consider repmat()? Related QuestionHaving problem with a function to define h acording to the volume!Invalid syntax: Might be missing a closingHow to Plot a Complex Function
Best Answer