Import archive .txt and the values are wrong when import
Show older comments
Hello!
I am new in matlab I guess this code are so simple, but I don't understand what is wrong with them, when I call the .txt file and call the Permeability matrix don't show the same values (picture in bottom). But the plot are corret. The problem whit this is when I want to find values when the plot are flat the program gave me the values from .txt and that values are wrong. I dont know what is my mistake?
Thanks for all, I hope understand me
This is my code:
close all;
clearvars;
clc;
%% import data for permeability
Permeability = importdata('Permeabilidad1.txt');
%% Plot for presure
Pet = Permeability(:,1); %%Call measure of time
Pre = Permeability(:,2); %% Call measure of presure
Pet3 = (Pet - (43767.399))*1000
figure (1)
plot(Pet3, Pre, '-r');
title('Medida de presi?n en funci?n del tiempo')
legend('Oil recovery oil-wet','Location', 'southeast')
xlabel('Tiempo')
ylabel('Presi?n')
xlim([0 8])
%ylim([0 0.9])
%grid on
%% whan to know the mean of the values when the plot are flat
PetX = 24.7 < Pet < 35.21;
Pet(PetX);
PromPetX = mean(Pet(PetX));
PetY = 235.9 < Pre < 235;
Pre(PetY);
PromPetY = mean(Pre(PetY));

4 Comments
Rik
on 13 May 2020
Can you attach the data that results in this? You may need to put it in a zip file first.
Cristian camilo García Castaño
on 13 May 2020
Edited: Cristian camilo García Castaño
on 13 May 2020
Rik
on 13 May 2020
I can't reproduce your problem with this code. What release are you using?
Cristian camilo García Castaño
on 13 May 2020
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!