calculate summation of vectors
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Kha Le
el 17 de Sept. de 2021
Comentada: Kha Le
el 18 de Sept. de 2021
write a code with no loop that will calculate the following sum:
b = 500 + 501^2 + 502 + 503^2 +...+ (N-1)^2 + N, where N = 1000
0 comentarios
Respuesta aceptada
William Rose
el 17 de Sept. de 2021
@Kha Le, This sounds a lot like a homework question. Hints:
Break it into two parts: the sum of the unsquared terms plus the sum of the squared terms.
If you still don't know, then show what you have tried that did not work, and show if you got an error message, or you got an answer that you know is the wrong answer, etc.
Más respuestas (2)
Hernia Baby
el 17 de Sept. de 2021
Editada: Hernia Baby
el 17 de Sept. de 2021
I'll just write a hint.
Even = 0:2:10
Odd = 1:2:10
Square = (1:10).^2
Sum = sum(1:10)
3 comentarios
Hernia Baby
el 17 de Sept. de 2021
thx! But I'm wondering if I should answer this question completely because I found this looks like home work...
I will write just hint.
Image Analyst
el 17 de Sept. de 2021
If it wasn't tagged as homework, but you really suspect it is homework, you can give hints. You can ask them if it's their homework, and if they say no, then you can go on and give a full solution. If they say yes, I make sure it's tagged as homework (in case they didn't do it themselves) and I give them this link:
Ver también
Categorías
Más información sobre Matched Filter and Ambiguity Function 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!