Community Profile

photo

Thamrongsin Siripongsakul


Last seen: 8 months ago Active since 2023

Statistics

  • Thankful Level 2

View badges

Content Feed

View by

Question


How can I get the return of a constructed function as an array?
The constructed function is function [a] = triangle(n) a=zeros(size(n)); if (n>=0 & n<=pi) % use an if else statement...

1 year ago | 1 answer | 0

1

answer

Question


How can I construct a triangle function, when I tested one using 'integral(fun.-pi,pi)', error occurred.
function [a] = triangle(n) a=zeros(size(n)); a(n>=0 & n<=pi)=pi-n; end -------------------- >> fun = @(x)triangle(x) ...

1 year ago | 1 answer | 0

1

answer