Hi there, this is probably a very simple question- what is the right syntax for the following arguments:
(1) vector(3) xxx=(1 2 3)
(2) scalar a=@max(1 2)
Thanks
Basile
Max
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Max
I don't understand the question.
Re: Max
(1) I am trying to declare a vector and assign values, but the syntax "vector(3) xxx=(1 2 3)" generates an error. What is wrong with it?
(2) I am trying to apply to the max function on two scalars ("s1" and "s2"), but the syntax "a=@max(s1 s2)" generates an error. What is wrong with it?
Any suggestions? Thanks.
(2) I am trying to apply to the max function on two scalars ("s1" and "s2"), but the syntax "a=@max(s1 s2)" generates an error. What is wrong with it?
Any suggestions? Thanks.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Max
1). I'm not sure where you got that syntax from, but it is not EViews syntax.
2) Same as above.
Code: Select all
vector(3) xxx
xxx.fill 1,2,3
Code: Select all
scalar a = @recode(s1>s2, s1, s2)
Re: Max
Thanks, this is helpful.
(1) As for one, since the following works "vector(3) xxx=x" (where x is a predefined vector or scalar), I thought there is a way to use "1 2 3" instead of x. It looks like I was wrong.
(2) Your proposed solution works. So it looks like @max works only on a predefined matrix and vectors but does not work with scalars.
May I ask one more quick question:
(3) is there a way to delete a specific row (or column) from a matrix? Assume x is 10x5 matrix and I would like to delete the rows (or columns) 3-4? What if want to delete the first 2 rows?
Much appreciated.
(1) As for one, since the following works "vector(3) xxx=x" (where x is a predefined vector or scalar), I thought there is a way to use "1 2 3" instead of x. It looks like I was wrong.
(2) Your proposed solution works. So it looks like @max works only on a predefined matrix and vectors but does not work with scalars.
May I ask one more quick question:
(3) is there a way to delete a specific row (or column) from a matrix? Assume x is 10x5 matrix and I would like to delete the rows (or columns) 3-4? What if want to delete the first 2 rows?
Much appreciated.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Max
You'll have to use the extract functions (@rowextract, @colextract, @subextract) to take the pieces you want into new matrices. There is no delete function for matrices.
Who is online
Users browsing this forum: No registered users and 1 guest
