Use for loop to assign zeros function to a variable size array
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have the following piece of code and I would like to use a for loop to shorten it and also make it more general in case I have more that four sets of initicial conditions (IC)
Nz = 200;
number = 4;
IC_A1 = zeros (1, Nz); %for C
IC_B1 = zeros (1, Nz); %for q
IC_A2 = zeros (1, Nz); %for C
IC_B2 = zeros (1, Nz); %for q
IC_A3 = zeros (1, Nz); %for C
IC_B3 = zeros (1, Nz); %for q
IC_A4 = zeros (1, Nz); %for C
IC_B4 = zeros (1, Nz); %for q
IC = [IC_A1 IC_B1; IC_A2 IC_B2; IC_A3 IC_B3; IC_A4 IC_B4];
Do I need to use Cell array?
0 comentarios
Respuestas (1)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!