I'm trying to extract position data that brought in from a plot that I made, that is saved as a structure

1 Ansicht (letzte 30 Tage)
MATLAB saves this as a structure variable, I'm trying to extract the x, y position data as vectors. The position field looks like 1,2 for 16 element and I'm trying to sort these out into vectors. I have tried s.f and it gives me both x and y for all values but when I do a = s.f it only gives me the first value?
  2 Kommentare
Jonathan Duncan
Jonathan Duncan am 6 Okt. 2017
Bearbeitet: Jonathan Duncan am 6 Okt. 2017
cell4_50um(:).Position, I've provided and image of the structure what I'm trying to to is just parse out the chosen position coordinates from my plot into x and y vectors. or at this point just a single vector

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

KSSV
KSSV am 6 Okt. 2017
s = struct ;
for i = 1:10
s(i).f = [rand rand] ;
end
k = reshape([s.f],2,[])' ;
  2 Kommentare
KSSV
KSSV am 6 Okt. 2017
I am trying to make a structure with random data for demonstration.... rand gives a random number.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by