How do you make an input variable name = ' : ' ?
Mostra commenti meno recenti
How do you make an input variable name = ' : ' in order to use the input name to access values in a (m x n x 3) uint8 array?
function [ new ] = array( row, col )
new(:,col,:) = []; % this only works if there are 2 :
the input variable is Row but it needs to be : so that i can delete this number in the array.
2 Commenti
James Tursa
il 1 Set 2015
Modificato: James Tursa
il 1 Set 2015
Please provide a short example, in pseudo-code if needed, of what you would like to do. E.g., give the variables you start with, and the result you are looking for. A string variable can hold ':' of course, but that can't be the actual name of a variable.
Maia Wati-Cooper
il 1 Set 2015
Risposta accettata
Più risposte (1)
Image Analyst
il 1 Set 2015
1 voto
You can't have a function that deletes a column from all planes of a 3D array if you don't pass in the array! In your function called array (a bad name in my opinion), you try to delete the column indicated by "col" from an array called "new" yet "new" does not even exist yet! Obviously, "new" must exist before you can delete things from it.
And that would not delete a number - it would delete a slice. Imagine that you have a 3D array that is a color RGB image where the indexes are (row, column, colorChannel). So you're saying to delete all rows and all colors of a particular column. So if your array was 480 rows tall by 640 columns wide, by 3 color planes high, and you wanted to delete column 42, you'd have like a vertical slice of 480 rows tall by 3 color planes high at column 42. So you'd be removing that 480 by 3 slice of values from the 3D array. That is a bunch of values, not just one value. And, like I said, that 3D array has to exist first before you can delete anything from it.
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!