create two vectors of the measured data in matlab

To create two vectors of measured data in Matlab, you can follow these steps:

  1. Define the measured data in array format. Let's consider that we have measured the temperature and pressure for a gas sample at different time intervals. We can define our data as follows:
main.m
data = [20, 25, 30, 27, 26; 101.3, 101.5, 100.9, 101.1, 101.2];
64 chars
2 lines

In this case, the first row of the array represents the measured temperature values, while the second row represents the measured pressure values.

  1. Create two separate vectors using the values from the array. To create a vector of temperature values, we can extract the first row from the array as follows:
main.m
temperature = data(1, :);
26 chars
2 lines

Similarly, to create a vector of pressure values, we can extract the second row from the array as follows:

main.m
pressure = data(2, :);
23 chars
2 lines

Now, you can use these vectors for any further analysis or processing in Matlab.

gistlibby LogSnag