| MATLAB Central > MATLAB Newsreader > How to expand a matrix? |
|
|
|
Hi, |
|
Help kron |
|
Thanks Bruno. You always answer all of my questions. |
|
You are welcome. If you want to force your processor to multiplication and addition unnecessary, and to avoid KRON then here is another way: |
|
I'm a bit confused. Why would I want to do it the second way? Is it faster? Is it more advantages for any reason? Seems like kron does it fast and easy. |
|
I'm not sure. KRON is more general purpose, it performs many matrix multiplications. In our case it is trivial scalar with 1. Whereas the second method just duplicate and moving elements around. I'm not sure which one is faster. |
|
Just another method, using built-ins only: |
|
Along the same line than Matt's solution using BSXOPS on FEX: |
|
Yet another method |
|
Hmmm. Weird character translation problem... |
|
"Matt " <xys@whatever.com> wrote in message <gtk66u$f3g$1@fred.mathworks.com>... |
|
"Matt " <xys@whatever.com> wrote in message |
|
"Matt Fig" <spamanon@yahoo.com> wrote in message <gtkeon$rhl$1@fred.mathworks.com>... |
|
"Matt Fig" <spamanon@yahoo.com> wrote in message <gtio1e$dj3$1@fred.mathworks.com>... |
|
"Kian " <kian.torab@utah.edu> wrote in message <gtq2qh$blq$1@fred.mathworks.com>... |
|
"Kian " <kian.torab@utah.edu> wrote in message <gtq2qh$blq$1@fred.mathworks.com>... |
|
"Matt Fig" <spamanon@yahoo.com> wrote in message <gtq4s5$6so$1@fred.mathworks.com>... |
|
"us " <us@neurol.unizh.ch> wrote in message |
|
Re find submatrix: Matt, a lazy hint: it takes only two lines to typecast the double/single array to respectively int64/int32, then compares with strfind. The NaN issue will be resolved in no time. You might continue to hang around here. ;-) |
|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gtq8i9$lpv$1@fred.mathworks.com>... |
|
:-) |
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
| Tag Activity for This Thread | ||
|---|---|---|
| Tag | Applied By | Date/Time |
| elvis presley | us | 5 May, 2009 17:14:25 |
| expand matrix m... | Kian | 2 May, 2009 18:04:02 |
Contact us at files@mathworks.com
