- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I want to keep some elements of a vector without using a for-loop. For example,
x = [ 10 20 30 40 .... 100] and index = [1 5 10];
In MATLAB you use x(1,index).
Could you please tell me if there is a command with mkl?
Thank you very much.
F.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MKL is a library of routines, and those routines can be called from compiled languages such as C and Fortran. Matlab, Python, etc., are interpreted languages with facilities to call MKL routines. Your question has very little to do with MKL, but relates to the ability of a language to support arrays and vector indices into arrays.
In Fortran, for example, the following program can be written.
program tvec real :: x(10) = [10,20,30,40,50,60,70,80,90,100] integer :: ix(3) = [1,5,10] ! print *,x(ix) ! end program
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MKL is a library of routines, and those routines can be called from compiled languages such as C and Fortran. Matlab, Python, etc., are interpreted languages with facilities to call MKL routines. Your question has very little to do with MKL, but relates to the ability of a language to support arrays and vector indices into arrays.
In Fortran, for example, the following program can be written.
program tvec real :: x(10) = [10,20,30,40,50,60,70,80,90,100] integer :: ix(3) = [1,5,10] ! print *,x(ix) ! end program
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page