Home > Back-end >  A set of data divided by another group method of data
A set of data divided by another group method of data

Time:01-09

For example: A={1, 2, 3, 4, 5}, B={2,3,4,5,6}
To calculate A [0]/[0] B... [4], A [4]/B function can be achieved?

CodePudding user response:

Matlab is very good

CodePudding user response:

Write a function

CodePudding user response:

A cycle, if not just two loops

CodePudding user response:

I will pick up points to
 # include 
Int main ()
{
Void arr_division (float * a, float * b, int arrlen);
Float a [5]={1, 2, 3, 4, 5}, b [5]=,3,4,5,6 {2};

Arr_division (a, b, 5);

return 0;
}


Void arr_division (float * a, float * b, int arrlen)
{
Temp=new float float * [arrlen];
Memset (temp, 0, sizeof (float) * arrlen);

for(int i=0; i\ [I]=[I] a [I]/b;
Printf (" a [% d]/[% d]=% b. 2 f \ n ", I, I, \ [I]);
}
}

CodePudding user response:

The
reference 3 floor CHXCHXKKK response:
a cycle, if not just two loops

Indeed, he this just a for loop,,,, pay attention to the data type int and float or double

CodePudding user response:

Thanks for your reply, want to ask is have already in the standard function, are not written by yourself,,,

CodePudding user response:

refer to 6th floor sinat_41752325 response:
thanks for your answer, want to ask is have already in the standard function, are not written by yourself,,,

No,

What is standard?
C standard?
C + + 1 x standard?
STL standard?
The boost standards?

CodePudding user response:

Of course, inner_product function
  • Related