Hi,

I need help in converting a few functions from matlab to VC++. Here's the code that I have done partially in C++ and some are still in MATLAB.



#include "mbed.h"
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include "iostream"
//#include "math.h"




Norma::Norma(){}//constructor


Norma::~Norma(){}//destructor


void Norma::norma(float Dn)
{
float D;
int ni;
float Dn;

[~,ni] = sizeof(D);
if (ni == 1)
Dn = (D - min(D))./(max(D)-min(D)); //convert this equation in C++
else
vmaxD = max(D); vminD = min(D);
for (int i = 1; i<= ni; i++)
{
Dn(:,i) = (D(:,i) - vminD(i))./(vmaxD(i)-vminD(i));//convert this equation in C++
}

}