vector of functions direct assignment
- June 30, 2016
- 5 replies
- 4557 views
Hello,
maybe this is a silly question but i've not found useful results in forum.
I'm looking for create an array of function, something like :
direct_fun_vect(v)1:= v1+ 2*v2 +3*v3
direct_fun_vect(v)2:= v1 - v2
ect..
in a way that mathcad knows that each row is a function of v-vector (v1 , v2 ,v3).
I've found a solution writing the single function like :
f1(v):= v1 + 2*v2 +3*v3
f2(v):= v1 - v2
ect.
and then assigning manually each function to a relative place in a vector like :
manual_fun_vec1:=f1(v)
manual_fun_vec2:=f2(v)
ect.
But in this way i'cant evaluate directly for example the i-esim function in an assigned vector x : ( 4; 1 ; 7)
Like : manual_fun_vec1(x) -->
I've to do a temp passage : tmp(v):=manual_fun_vec1
then i can do : tmp(x) -> to obtain result.
I'm searching for a direct assign like :
direct_fun_vec(v)1:= v1 + 2*v2 +3*v3
ect.
so i can evaluate each function in a for cycle like :
for i e 1..N
sum<- sum + direct_fun_vect i (v)
See the attached file to understand well.


