Output as an vector
显示 更早的评论
Heya,
For my class i have to Create a Algorithm to Approximate something and calculate the relative error but i can't seem to find the right way to Output it.
so we're given something like this (Wich we have to use exactly like this) "[Approximation,RelativeError] = Algorithm(x,n)". we must output it in a 1x2 vector, but everytime i call the function, only the Approximation is in the "ans". i know, that i can force it to give me both outputs, by inputting "[Approximation,RelativeError] = Algorithm(x,n)" (Wich i don't think the MatLab Grader we're using is doing) or just creating a Vector like A = [approximation,RelativeError] but the Grader won't check in the Vector A.
is there a way to Output that Function in a Vector by just Inputting "Algorithm(x,n) ?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!