MATLAB: What is the problem with this code snippet function handle function phi1= @(y) 2*(y-0.5)*(y-1) It says 'Invalid use of operator' on run. Best Answer https://in.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html phi1 = @(y) 2*(y-0.5)*(y-1) Related SolutionsMATLAB: How to vectorize the following code snippet x = -1.0:0.2:1.0;y = -2:0.25:3;[X,Y] = meshgrid(x,y) ; result = exp(X.^2-Y.^2); MATLAB: How to simplify the given code snippet colX2 = reshape(bsxfun(@plus,X,bsxfun(@times,t',dx(1:3))),[],1);orcolX2 = reshape(bsxfun(@plus,X,t'*dx(1:3)),[],1) Related QuestionCan you save snippets in matlabHow to vectorize the following code snippetThis code snippet causes Matlab to crashHow can i make this code snippet a functionIs Time=t declared in this code snippet
Best Answer