How can I plot from csv file?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gyujin Park
le 9 Mai 2023
Commenté : Gyujin Park
le 14 Mai 2023
Hi!
I am try to plot this csv file with shadowed error. (this is my photometry deltaF/F data with s.e. and I caculate average using excel )
Actually my lab person show to me but after than he delete code.
So I know I need caculate x as time using frame rate, and show him this note from TDT data.
Thanks for your help!
Object ID : RZ5P(1) - RZn Processor
Rate : 6103.5 Hz
Store ID : PC2/
Source : Strobe input
Invert : No
Offset : Yes
Count : Yes
Store ID : PC3/
Source : Strobe input
Invert : No
Offset : Yes
Count : Yes
Object ID : FibPho1 - Fiber Photometry
Store ID : 470A
Format : Float-32
Scale : Unity
Rate : 1000.0 Hz
Store ID : 405A
Format : Float-32
Scale : Unity
Rate : 1000.0 Hz
Store ID : Fi1d
Format : Float-32
Scale : Unity
Rate : 6103.5 Hz
Store ID : Fi1i
Mode : Single scalar
Format : Float-32
Scale : Unity
Pre Cap : 0.00 ms
Store ID : Fi1r
Format : Float-32
Scale : Unity
Rate : 6103.5 Hz
0 commentaires
Réponse acceptée
Sulaymon Eshkabilov
le 10 Mai 2023
Here is how to get some shadow error plot:
% Way 1. Not nice looking plot
D = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1379164/photometry.csv');
t = D(1,:); % Note that your time data is repeated values.
% That is why the time signal is recreated
t = linspace(min(t), max(t), numel(t));
y1 = (D(2,:));
SE = D(3,:);
y2 = (y1 + SE);
figure
ax = axes;
patch([t fliplr(t)], [y1 fliplr(y2)], [0.8 0.8 0.8], 'EdgeColor', 'r', 'FaceAlpha', 0.5)
grid on
ax.XAxisLocation = 'origin';
hold on
yy = .5*(y1+y2);
plot(t, yy, 'k', 'LineWidth', 2)
% Way -2. Nice looking plot
%% Smooth your data and plot it:
D = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1379164/photometry.csv');
t = D(1,:);
t = linspace(min(t), max(t), numel(t));
y1 = smoothdata(D(2,:));
SE = D(3,:);
y2 = smoothdata(y1 + SE);
figure
ax = axes;
patch([t fliplr(t)], [y1 fliplr(y2)], [0.8 0.8 0.8], 'EdgeColor', 'r', 'FaceAlpha', 0.5)
grid on
ax.XAxisLocation = 'origin';
hold on
yy = .5*(y1+y2);
plot(t, yy, 'k', 'LineWidth', 2)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Identification dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

