Skip to Main Content
Programming in MATLAB ®: A Problem-Solving Approach by Pearson
book

Programming in MATLAB ®: A Problem-Solving Approach by Pearson

by Ram N. Patel, Ankush Mittal
May 2024
Intermediate to advanced content levelIntermediate to advanced
433 pages
13h 7m
English
Pearson India
Content preview from Programming in MATLAB ®: A Problem-Solving Approach by Pearson
Object Oriented Design É 321
y = mxGetPr(plhs[0]);
/* Call the C subroutine. */
trans(x,y,mrows,ncols);
}
Compile the file with,
>> mex trans.c
Now, if you give an input matrix y as:
>> y = [1,2,3;4,5,6;7,8,9];
>> trans(y)
ans =
1 4 7
2 5 8
3 6 9
Time for Practice 11.10
Based on these examples try to make a MEX code for finding out the conjugate transpose
of a matrix with complex numbers.
Note:
1. If there is a MEX-file and an M-file with the same name, the MEX-file gets preference over
the latter during execution.
2. It is not necessary to have a computational routine in every MEX-file; it is just a subroutine
which can be eliminated if there is no numeric ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied Numerical Methods Using MATLAB, 2nd Edition

Applied Numerical Methods Using MATLAB, 2nd Edition

Won Y. Yang, Wenwu Cao, Jaekwon Kim, Kyung W. Park, Ho-Hyun Park, Jingon Joung, Jong-Suk Ro, Han L. Lee, Cheol-Ho Hong, Taeho Im
MATLAB Recipes: A Problem-Solution Approach

MATLAB Recipes: A Problem-Solution Approach

Michael Paluszek, Stephanie Thomas
Practical MATLAB Deep Learning: A Projects-Based Approach

Practical MATLAB Deep Learning: A Projects-Based Approach

Michael Paluszek, Stephanie Thomas, Eric Ham

Publisher Resources

ISBN: 9781306983440Publisher Website