7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Shaymaa Tahhan am 22 Feb. 2024
Beantwortet: Voss am 22 Feb. 2024
- intensity with lines.fig
In MATLAB Online öffnen
Please I have tried alot with this code
open('spectrum.fig');
a = get(gca,'Children');
xdata = get(a, 'XData');
ydata = get(a, 'YData');
xdata1 = get(a(2), 'XData');
ydata1 = get(a(2), 'YData');
but it doesnt work correctly I just get the last line data?!
0 Kommentare -2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden
-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden
Melden Sie sich an, um zu kommentieren.
Melden Sie sich an, um diese Frage zu beantworten.
Antworten (1)
Voss am 22 Feb. 2024
In MATLAB Online öffnen
- intensity with lines.fig
f = openfig('intensity with lines.fig');
lines = findall(f,'Type','line')
lines =
10×1 Line array: Line Line Line Line Line Line Line Line Line Line
xdata = get(lines,'XData'); % xdata: 10x1 cell array, each cell contains 1 line's XData
ydata = get(lines,'YData'); % ydata: 10x1 cell array, each cell contains 1 line's YData
If you know that the lines XData/YData are all row vectors of the same size (which they are in this case), it may be convenienet to concatentate them into a single matrix:
xdata = vertcat(xdata{:})
xdata = 10×8192
1.0e-11 * -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206 -0.6250 -0.6248 -0.6247 -0.6245 -0.6244 -0.6242 -0.6241 -0.6239 -0.6238 -0.6236 -0.6235 -0.6233 -0.6232 -0.6230 -0.6229 -0.6227 -0.6226 -0.6224 -0.6223 -0.6221 -0.6219 -0.6218 -0.6216 -0.6215 -0.6213 -0.6212 -0.6210 -0.6209 -0.6207 -0.6206
ydata = vertcat(ydata{:})
ydata = 10×8192
1.0e+00 * 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
so that xdata(1,:) is the first line's XData, xdata(2,:) is the second line's XData, etc., etc.
0 Kommentare -2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden
-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden
Melden Sie sich an, um zu kommentieren.
Melden Sie sich an, um diese Frage zu beantworten.
Siehe auch
Kategorien
MATLABProgrammingProgramming Utilities
Mehr zu Programming Utilities finden Sie in Help Center und File Exchange
Tags
- data import
- figure data import
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Es ist ein Fehler aufgetreten
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- Deutsch
- English
- Français
- United Kingdom(English)
Asien-Pazifik
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)
Kontakt zu Ihrer lokalen Niederlassung