MATLAB: Hi i stuck in basics of matlab function command

function

clear all
clc
function [z,t]=calc(x,y)
z=x-y;
z=x+y;
i saved this file naming it calc.m but when i am giving input from main window the following error occurs
calc(2,3) % input ??? Error: File: calc.m Line: 3 Column: 1 Function definitions are not permitted in this context.

Best Answer

Delete the "clear all" and "clc"