请帮助我如何将代码从Matlab转换为C#? [英] help me please how can i transformation the code from matlab to C# ?

查看:150
本文介绍了请帮助我如何将代码从Matlab转换为C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该如何转型
下面的代码从matlab到C#?请解释代码?

clear

i = imread(''u.tif'');

%imhist(i)

[N M] = size(i);

%c(1,1:255)= zeros(1,255);

hist=zeros(1,256);

for r = 1 : N

    for c = 1 : M

        pix=i(r,c);

        xpix=pix+1;

        hist(xpix)=hist(xpix)+1;

    end

end

plot(hist);




感谢您的帮助

约翰^ _ ^!没有翻译工具可以帮助您完成这项工作.


戴夫所说的是100%正确的.您几乎不可能找到任何适用于Matlab和C#的翻译工具.话虽这么说,如果您想重现Matlab代码正在做的事情而不必一行一行地找出来,请查找为C#中的图像生成直方图.您应该可以使用Google以及在CodeProject上的此处找到一些很好的示例.


how can i transformation
the code below from matlab to C#? with explain the code please?

clear

i = imread(''u.tif'');

%imhist(i)

[N M] = size(i);

%c(1,1:255)= zeros(1,255);

hist=zeros(1,256);

for r = 1 : N

    for c = 1 : M

        pix=i(r,c);

        xpix=pix+1;

        hist(xpix)=hist(xpix)+1;

    end

end

plot(hist);




thanks for help

john ^_^ !

解决方案

By understanding precisely what the MATLAB code is doing and recoding, by hand, the exact same concepts in C#. There is no translation tool to do this for you.


What Dave said is 100% correct. You are very unlikely to find any translation tool for Matlab and C#. That being said, if you want to reproduce what the Matlab code is doing without having to figure it out line-by-line, look up producing a histogram for an image in C#. You should be able to find some good examples using Google and here on CodeProject.


这篇关于请帮助我如何将代码从Matlab转换为C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆