Azzera filtri
Azzera filtri

Matrix dimension must agree to use .*

1 visualizzazione (ultimi 30 giorni)
Neo
Neo il 31 Dic 2015
Commentato: Star Strider il 4 Gen 2016
I debugged my code and checked my workspace variables, and when I loaded in the two images their numbers were identical (matrix dimensions, their matrix dimensions after I manipulated them) yet when I use .* it still says an error because .* requires identical matrix dimensions, when, Q.E.D., that's what I have! Suggestions?
Cheers,
Neo Cornel

Risposta accettata

Star Strider
Star Strider il 31 Dic 2015
Without knowing what the images are and seeing your code, it’s difficult to determine the problem. That they’re images means that they could have three dimensions (the third being the colour channels in a RGB image), and if one is a grayscale image having two dimensions, you could get that error even if they have the same number of rows and columns.
  21 Commenti
Image Analyst
Image Analyst il 4 Gen 2016
If you wanted to make copies of something. Like if you manually made up a 2-by-2 checkerboard and you wanted to replicate it to be a 8-by-8 checkerboard for example.
Star Strider
Star Strider il 4 Gen 2016
... or for a number of other reasons, for instance if you are using textscan and want to replicate a format descriptor without typing out each one, use repmat('%f',1,10) to replicate ‘%f’ 10 times.
It’s highly useful, although if you’re operating on a matrix with a vector element-wise, bsxfun is usually faster.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Read, Write, and Modify Image in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by