I have a excel file having data at each cell, that is being converted to image, this image is to be partitioned in 4 equal images, now in this image i'll select a area which should tell the data values at that portion

1 view (last 30 days)
Amp=xlsread('C:\Users\AMIT\Desktop\CB\excel\4\Cast Billet Amp Data-(4-5).xls');
Th=xlsread('C:\Users\AMIT\Desktop\CB\excel\4\Cast Billet thickness Data-(4-5).xls');
Z=Amp(2:1:514,2:1:256); % rows nd columns
T=Th(2:1:514,2:1:256); % rows nd columns
for i=1:1:513
for j=1:1:255
if ((Z(i,j)>=60) && (Z(i,j)<=100)) % amp values only in this range
A(i,j)=Z(i,j);
B(i,j)=T(i,j);
else
A(i,j)=0;
B(i,j)=0;
end
end
end
for i=1:1:513
for j=125:1:225
C(i,j)= A(i,j);
D(i,j)= B(i,j);
end
end
axes('FontSize',20);
image(C');figure
axes('FontSize',20);
imagesc(D');figure
for i=1:1:513
for j=1:1:255
if B(i,j)>=6.5 && B(i,j)<=7.0 % this thick range is our area of interest
A4(i,j)=C(i,j);
else
A4(i,j)=0;
end
end
end
% after this I have to section the image of A4 in 4 equal parts
% in each image where I select I should get the Amp data of that area or point ( like crop)
  1 Comment
AMIT VERMA
AMIT VERMA on 4 Feb 2015
clc
clear
% take data frm xcl and look for selected area
Amp=xlsread('C:\Users\AMIT\Desktop\CB\excel\4\Cast Billet Amp Data-(4-5).xls');
Th=xlsread('C:\Users\AMIT\Desktop\CB\excel\4\Cast Billet thickness Data-(4-5).xls');
%X=Amp(515:514:131584);
%Y=Amp(2:1:514);
Z=Amp(2:1:514,2:1:256);
T=Th(2:1:514,2:1:256);
%axes('FontSize',20);
%image(Y,X,Z');figure
%axes('FontSize',20);
%imagesc(Y,X,T');figure
for i=1:1:513
for j=1:1:255
if ((Z(i,j)>=80) && (Z(i,j)<=100))
A(i,j)=Z(i,j);
B(i,j)=T(i,j);
else
A(i,j)=0;
B(i,j)=0;
end
end
end
for i=1:1:513
for j=125:1:225
C(i,j)= A(i,j);
D(i,j)= B(i,j);
end
end
axes('FontSize',20);
image(A');figure
axes('FontSize',20);
imagesc(B');figure
for i=1:1:513
for j=125:1:225
if B(i,j)>=6.5 && B(i,j)<=7.0
A4(i,j)=C(i,j);
else
A4(i,j)=0;
end
end
end
axes('FontSize',20);
%imagesc(Y,X,A4');figure
imagesc(A4');
ylim([120 225])
% this A4 is to be divided in to parts (4), and then manually select a area and corresponding amplitude value will be given
I am attaching excel files for help

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 4 Feb 2015
Do you want it divided into quadrants? Or do you want it to be manually specified? And if quadrants, where do you want to divide the rows at, because 513 is not divisible by 2. So do you want 256 rows and then 257 rows, or do you want 257 rows and then 256 rows? Anyway, why can't you use indexing - it's a trivial concept that people learn the first day they start using MATLAB?
upperLeft = A4(1:256, 1:112);
upperRight = A4(1:256, 113:end);
lowerRight = A4(257:end, 1:112);
lowerLeft = A4(257:end, 113:end);
If you want a demo to get a box region, I've attached a couple of demos.
  3 Comments
AMIT VERMA
AMIT VERMA on 5 Feb 2015
sorry buddy, it worked ... I behave dumb sometimes Now in these images wherever I select the value of that region should be displayed Just like demo that you posted when I select that area I want amplitude/amplitudes for corresponding points these amplitudes are in that amplitude excel files

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!