How can I plot from csv file?

조회 수: 2 (최근 30일)
Gyujin Park
Gyujin Park 2023년 5월 9일
댓글: Gyujin Park 2023년 5월 14일
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

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 5월 10일
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
Gyujin Park
Gyujin Park 2023년 5월 14일
Wow!
Thank you so much!!
I learn about Matlab and hope can create as like you!
Thanks again XD

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by