MATLAB: I want to write a code where equation is y=x*x. if y=100 what is the value of x if loop i have written z=100; for x=1:1:20 y=x*x if y==z fprintf(x) end end Best Answer >> f = @(x) x.^2 - 100;>> x = fzero(f,pi)x = 10 Related SolutionsMATLAB: How to plot function with conditions (3d) You can replace the unwanted values with nan.[x,y] = meshgrid (-2:2:2);z = x.*y;mask = x + y <= 1;z(~mask) = nan;surf(x,y,z) MATLAB: How to plot this function Try this instead:x=0:10:200;y=0:0.05:1;[X,Y]=meshgrid(x,y);Z=(-0.5)*X.*(X+1).*(X-1).*((Y.^X./X)-(2*(Y.^(X-1))./(X-1))+(Y.^(X-2))./(X-2)-2./(X.*(X-1).*(X-2)));surf(X,Y,Z)rotate3d on Related QuestionE^x/xHow to plot a constant Z value with varying X and YHow to solve tan(x)=x
Best Answer