This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Matlab vector max to eigen?

Tags: None
(comma "," separated)
bravegag
Registered Member
Posts
52
Karma
0

Matlab vector max to eigen?

Wed Dec 18, 2013 3:43 pm
Hello,

How can write the following Matlab max in Eigen?

Code: Select all
>> max(0, [1 2 3]' - 1.5)

ans =

         0
    0.5000
    1.5000


TIA,
Best regards,
Giovanni
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Matlab vector max to eigen?  Topic is solved

Wed Dec 18, 2013 4:11 pm
Array3d a, b;
a << 1, 2, 3;
b = (a-1.5).max();

If you are using matrices or vectors instead of array, use vec.array() to get access to array API.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]