How to Convert Matlab for-loop in Python
Mostra commenti meno recenti
I have a code in Matlab and need to convert it to python:
for idx = 1: numel(alpha)
x(idx) = radius * math.cos(math.pi/180*alpha(idx))
x(idx) = x (idx) + center(1)
y(idx) = radius * math.sin(math.pi/180*alpha(idx))
y(idx) = y (idx) + center(2)
end
I converted the first line with numpy as np to:
for idx in range(1, np.nummel(alpha)):
but i dont know how to convert the other lines.
It is an compute for an circle.
Thanks for every help.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Call Python from MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!