-
September 12th, 2011, 08:34 PM
#1
Matlab functions need conversion
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++
}
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|