Effacer les filtres
Effacer les filtres

how to convert a waveform in 2D matrix?

2 vues (au cours des 30 derniers jours)
ajeet verma
ajeet verma le 31 Mai 2017
Modifié(e) : KSSV le 31 Mai 2017
i want to generate triangular fringe pattern without using meshgrid function i have a code for triangular wave and i want to convert it into fringe pattern 2D matrix.
%triangular wave form
t=0:1/100:1;
f=5;
I3=asin(sin(2*pi*f*t));
plot(I3)

Réponse acceptée

KSSV
KSSV le 31 Mai 2017
YOu can use repmat
%triangular wave form
t=0:1/100:1;
f=5;
I3=asin(sin(2*pi*f*t));
plot(I3)
N = 101 ;
iwant = repmat(I3,N,1) ;
pcolor(iwant)
shading interp
  1 commentaire
ajeet verma
ajeet verma le 31 Mai 2017
Modifié(e) : KSSV le 31 Mai 2017
all right but i want to create matrix using for loop for example
% sinusoidal fringe fringe
m=1000;
n=1000;
f1=20; % No. of vertical fringes
f2=0; % No. of horizontal fringes
for i=1:m
for j=1:n
a(i,j)=exp(1i*(2*pi*(f1*j/n+f2*i/m)));
end
end
imshow(a,[])
this is sinusoidal fringe pattern and i want to create triangular as i asked

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Filtering and Enhancement dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by