I want to rotate the properties fromi=201:600(x) and J=201:600.(Y) That is the properties inside the area inside this area should be rotated. Can someone please help me?
3 次查看(过去 30 天)
显示 更早的评论
fid = fopen('moduli','r')
data = fread(fid, inf, 'single', 'ieee-be');
fclose(fid)
data = reshape(data,[800 800 3]);
for i=201,600
for j=201,600
end
end
figure(1)
pcolor(data(:,:,1))
axis tight;
shading interp;
colorbar;
set(gcf,'renderer','zbuffer')
print -dpng mod
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1270365/image.png)
2 个评论
回答(1 个)
Nehemiae
2023-3-10
Hello,
To rotate to rotate the submatrix of data, the “imrotate” function can be used. In the example below, the rotation is limited to the region of interest with the surrounding areas being set as 0, and the extruding areas being cropped. However, this can be configured by the “imrotate” options as per the requirement.
data(201 : 600, 201 : 600, 1) = imrotate(data(201 : 600, 201 : 600, 1), 45, "bilinear", "crop");
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1320000/image.png)
The documentation on the “imrotate” function (https://www.mathworks.com/help/images/ref/imrotate.html) is helpful in this regard.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!