How can I plot from csv file?

2 visualizzazioni (ultimi 30 giorni)
Gyujin Park
Gyujin Park il 9 Mag 2023
Commentato: Gyujin Park il 14 Mag 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

Risposta accettata

Sulaymon Eshkabilov
Sulaymon Eshkabilov il 10 Mag 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)
  1 Commento
Gyujin Park
Gyujin Park il 14 Mag 2023
Wow!
Thank you so much!!
I learn about Matlab and hope can create as like you!
Thanks again XD

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Data Type Identification in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by