Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

I am trying to make graphs from data in a folder on Matlab but I am having trouble even beginning. I am comparing the data for blue crabs crossing two separate antennaes. The file contains four different records.

Asked by Zach White

Zach White (view profile)

on 29 Mar 2013

the code is as follows. I need to separate each record (r1 stands for record 1 and so on) into graphs containing A1 data and A2 data for each and then as a whole once the preliminary graphs are completed. The axes need to be # of crabs on the y axis and Antennae 1 and Antennae 2 on the X in a bar graph format. I jut need a walk through of how to do this once and then I will be able to figure things outs once this kind of information arises again.

idx_r1_A1 = find ( ant_num_r1 == 1 );
idx_r1_A2 = find ( ant_num_r1 == 2 );
idx_r2_A1 = find ( ant_num_r2 == 1 );
idx_r2_A2 = find ( ant_num_r2 == 2 );
idx_r3_A1 = find ( ant_num_r3 == 1 );
idx_r3_A2 = find ( ant_num_r3 == 2 );
idx_r4_A1 = find ( ant_num_r4 == 1 );
idx_r4_A2 = find ( ant_num_r4 == 2 );
% ___
fig_landscape
% ___
subplot (211)
hold on
plot ( time_r1 (idx_r1_A1), tag_num_r1 (idx_r1_A1), 'b+')
plot ( time_r1 (idx_r1_A2), tag_num_r1 (idx_r1_A2), 'bo')
l1 = legend ('Ramp A1', 'Ramp A2');
set (l1, 'Box', 'off');
plot ( time_r2 (idx_r2_A1), tag_num_r2 (idx_r2_A1), 'b+')
plot ( time_r2 (idx_r2_A2), tag_num_r2 (idx_r2_A2), 'bo')
dateaxis ('x', 6);
xlabel ('Time (MM/DD)');
ylabel ('RFID tag number');
set (gca, 'YLim', [300 800]);
% ___
subplot (212)
hold on
plot ( time_r3 (idx_r3_A1), tag_num_r3 (idx_r3_A1), 'mx')
plot ( time_r3 (idx_r3_A2), tag_num_r3 (idx_r3_A2), 'mo')
l1 = legend ('Ramp A1', 'Ramp A2');
set (l1, 'Box', 'off');
plot ( time_r4 (idx_r4_A1), tag_num_r4 (idx_r4_A1), 'mx')
plot ( time_r4 (idx_r4_A2), tag_num_r4 (idx_r4_A2), 'mo')
dateaxis ('x', 6);
xlabel ('Time (MM/DD)');
ylabel ('RFID tag number');
set (gca, 'YLim', [300 800]);
Zach White

Zach White (view profile)

Tags

Products

No products are associated with this question.

0 Answers

Contact us