How to insert values across a whole matrix from a given data array.

1 vue (au cours des 30 derniers jours)
Kyriakos Athanasiou
Kyriakos Athanasiou le 26 Mar 2020
Hi there,
So for one of my projects, I'm working on the inverse Radon transform.
To make a long story short and to better explain what I need, here is my code so far:
M = zeros(200,200);
for angle=0:1:180
G = imrotate (M, angle, 'nearest', 'crop');
end
As you can see, I have matrix M which is 200x200. In another script I have for the forward process of the Radon transform, I have a 200x181 data array called S1.
I basically need to insert the first column of S1 ( S1(:,1) ) throughout the whole of matrix M (such that I essentially get matrix M to be 200x200 with all columns being that of S1(:,1) ) , rotate it by one degree (hence the for loop), and then insert the second column of S1 ( S1(:,2) ) over the already inserted first column of S1 (I need to be able have the values of the newly added S(:,2) summed with the overlapped S1(:,1) ), rotate again, etc. until I have fully rotate by 180 degrees and performed this iteration with all 181 columns of array S1.
Its quite frustrating as though I have the idea in mind, I am completely new to Matlab and don't know how to entirely translate this to the needed code and I am not getting much luck searching through a lot of answers and forums I've gone through.
I essentially just need to know how to insert the first column of S1 throughout M and then how to subsequently insert the second column of S1 to M however this time adding the values which overlap in the resulting columns of M; M should still remain 200x200.
As you can tell, the 181 columns of S1 do indeed correspond to the 181 rotations needed (they're the sum of the pixels of my image per rotation for which I am performing the transform on; this was done in the forward process hence giving S1 which contains all this data).
Any and all help will be highly appreciated! :) If you need any further clarification, don't hesitate to ask.

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by