Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Can anybody convert my c code to matlab code?Thank you
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Barenya Bikash Hazarika
el 19 de Jun. de 2018
Cerrada: MATLAB Answer Bot
el 20 de Ag. de 2021
#include<stdio.h>
#define MAX_SIZE 5
int main()
{
int arr[MAX_SIZE]; %Declare an array of MAX_SIZE
int i,j, N;
// Input array size
printf("Enter size of array: ");
scanf("%d", &N);
// Input elements in array
printf("Enter %d elements in the array : ", N);
for(i=0; i<N; i++)
{
scanf("%d", &arr[i]);
}
// Print all elements of array
printf("\nElements in array are: ");
for(i=0; i<N; i++)
{
for(j=i; j<N; j++)
{
printf("%d, ", arr[i,j]);
}
printf("\n");
}
return 0;
}
0 comentarios
Respuestas (1)
KSSV
el 19 de Jun. de 2018
I think this is what your c-code does: https://in.mathworks.com/matlabcentral/answers/117017-how-do-i-create-a-square-matrix-based-on-user-input
1 comentario
Barenya Bikash Hazarika
el 19 de Jun. de 2018
Editada: Barenya Bikash Hazarika
el 19 de Jun. de 2018
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!