Azzera filtri
Azzera filtri

Re-write the following code so that it avoids using a loop. N = 10; a = zeros(1, N); b = zeros(1, N); for i = 1:N a(i) = i; b(i) = a(i) * a(i); end

2 visualizzazioni (ultimi 30 giorni)
  1. Re-write the following code so that it avoids using a loop.
N = 10;
a = zeros(1, N);
b = zeros(1, N);
for i = 1:N
a(i) = i;
b(i) = a(i) * a(i);
end
  4 Commenti

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Problem-Based Optimization Setup in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by