What does X = [X Y] mean ?

70 Ansichten (letzte 30 Tage)
Bachtiar Muhammad Lubis
Bachtiar Muhammad Lubis am 30 Okt. 2018
Beantwortet: Breilyn Bautista am 17 Nov. 2019
I have the code approximately like this :
Word =[];
for m = 1 : N
Letter = read_letter(img, num_letters) %read_letter is the file function to correlate my .mat with character image(img) and then determining that img as a letter eg.('a','b' or 'c' ect.)
Word = [Word Letter];
end
So the question is. Are the values inside of Word variable are letters ? Additional:Does Word variable works like Unary Operation ?
Because i can't access this array to take its values with simple for loop like :
chars = ''; % i dont know whether this is necessary or nah
for m = 1 : length(Word)
if Word(m) == 'a' || Word(m) == 'b'
chars = 'character is a or b !';
end
end
disp(chars);
  1 Kommentar
Stephen23
Stephen23 am 30 Okt. 2018
Bearbeitet: Stephen23 am 30 Okt. 2018
"What does X = [X Y] mean"
It is a concatenation operator:
"Does Word variable works like Unary Operation ?"
How can a variable "work like" an operator?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 30 Okt. 2018
I don't know exactly what read_letter does, but if it returns a character, then Word is a character array - basically a vector (1-D array) of letters.
If you need more help, attach
  1. your .mat file,
  2. your image file, and
  3. your code for the read_letter() function
  2 Kommentare
Bachtiar Muhammad Lubis
Bachtiar Muhammad Lubis am 5 Nov. 2018
Bearbeitet: Bachtiar Muhammad Lubis am 5 Nov. 2018
this is my files. Sorry for my late respon. because i didnt get any notification. By the way now i can access the array list. with for loop function.
Image Analyst
Image Analyst am 5 Nov. 2018
OK. Not sure why you didn't get an email. It automatically does that. You might want to check your junk mail folder or check the email you have registered here to make sure it's right.
Thanks for doing #3 (attaching code). I'll get notified when you've done #1 and #2.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Breilyn Bautista
Breilyn Bautista am 17 Nov. 2019
como se realisa esta operacion en matlad A-[X'Y']

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Produkte


Version

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by