how can we create image through dataset consisting of 702 rows and 1 column?

1 view (last 30 days)
I want to create image from the dataset consisting of 702 rows and 1 column. Can you help me with the matlab code for creating the image?
thanks
  5 Comments
Walter Roberson
Walter Roberson on 22 May 2022
Do you have several of these files, one for each frequency, with the 702 being locations?
Do you have several of these files, one for each location, with 702 being the number of frequencies?

Sign in to comment.

Answers (3)

Walter Roberson
Walter Roberson on 26 Apr 2022
I = reshape(Data, 26, 27);
imshow(I, [])
  2 Comments
Walter Roberson
Walter Roberson on 27 Apr 2022
702 pixels can be factored into rectangles in multiple ways. The 26*27 or 27*26 seems most likely, unless the pixels are rgb or unless the image is known to have a 2:3 or 3:2 aspect ratio.

Sign in to comment.


Image Analyst
Image Analyst on 22 May 2022
Attach one of the CSV files. Basically you just read in the CSV file and it's automatically an spectrogram image that can be displayed.
grayImage = readmatrix(csvFileName);
[rows, columns] = size(grayImage)
imshow(grayImage, []);
ylabel('Row', 'FontSize', 18);
xlabel('Frequency', 'FontSize', 18)
  6 Comments
Shruti Awasthi
Shruti Awasthi on 22 May 2022
first column is representing the frequency range (from 3 to 11GHz, with an increement of 0.1 GHz). and rest of the columns are representing 19 different locations. For each frequency, there is different data for the the different 19 locations.
i want the sinlge image.
i forgot the password for the other account, created a new one.

Sign in to comment.


Image Analyst
Image Analyst on 22 May 2022
Try this:
filename = 'x_19_loc(without).csv';
data = readmatrix(filename);
freq = data(:, 1);
[rows, columns] = size(data)
XData = [1, columns];
YData = [min(freq), max(freq)]
imagesc(mat2gray(data(:, 2:end)));
colormap(gray(256))
% imshow(data(:, 2:end), [], 'XData', XData, 'YData', YData, 'InitialMagnification', 2000000);
grid on;
xlabel('Location')
ylabel('Frequency')
axis('on')
xticks(1:columns)
  3 Comments
Image Analyst
Image Analyst on 22 May 2022
Sorry, I don't know how to wrangle your data into the proper format for further processing. You'll have to figure that out on your own.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!