# How can I convert Matlab code to c#?

Let’s learn how can I convert Matlab code to c#. The most accurate or helpful solution is served by Stack Overflow.

There are ten answers to this question.

Best solution

What is C++ translation for Matlabs `fread(fp, 1, 'int32')` and fread(fp, n, 'uchar')

So I try to convert such Matlab code to C++: ss = 'file.mask' fp = fopen(ss, 'rb'); sx = fread(fp, 1, 'int32') sy = fread(fp, 1, 'int32') mask = zeros(sy, sx); mm = mask(100, 100:200); count = zeros(10, 1); for i = 1:sy row = fread(fp, sx, 'uchar'); for j = 1:sx for k = 1:10 if row(j) == k - 1 count(k) = count(k) + 1; end end end mask(i, :) = row; end fclose(fp); And so I wonder what is C++ analog of Matlab fread?

If you really want a C++ analog and not a C analog (or even a C/C++ analog), then you should rather...

Spender at Stack Overflow

Other solutions

Please can any one tell me how to convert binary code [1,0] to [+1,-1] using matlab?thanx.?

i have a problem in finding any instruction in matlab to convert from the normal binary code to bipoles (biphase) code, to use it in communication system?

Multiply by 2 and subtract 1: >> UnipolarVariable = round(rand(5,1)) UnipolarVariable = 1 1 0...

Help me to convert this C++ code to matlab code...?

/* convolution */ #ifndef CONVOLVE_H #define CONVOLVE_H #include <vector> #include <algorithm> #include <cmath> #include <math.h> #include "image.h" /* convolve src with mask. dst is flipped! */ static void convolve...

Mmm try 'doc conv2', looks like basic 2D convolution.

How do I convert Octave code to C or C++ ?

I wish to run my Octave code on a Windows Embedded device. If there is no tool available for converting Octave, can I copy the code into MATLAB and use some tool to convert it to C or C++ ? How?

There are at least 2 packages that can convert many Octave operations to C++: Example Conversion of...

Ken Meltsner at Quora

Matlab- Saving an image?

I wanted to know what is the difference between imshow(I2, []) and imshow(I2) I checked out your post on Background Illumination and the image is dark when using only imshow(I2) while the image is great when using imshow(I2, []) The problem I am facing...

b=a[:,:]

umm...idk?

Matlab binary to decimal conversion?

using the pseudo code below, what would the matlab code be for Problem 1. Implement in matlab the following functions: 1. function DecimalToBinary (d) 2. function BinaryToDecimal (b) 3. function BinarySum (a1,a2) 4. function BinaryProd (f1,f2) The &...

converting MATLAB routine to an executable file

I've found a MATLAB routine which I'd like to run but I don't have MATLAB. I need someone convert it into an executable file (or into a code that can be run in a freely accessable language). The routine is called "comb_unrank.m" which is found...

Hi, xman-ga: Yes, I remember the earlier question! There is an open source mathematical modeling package...

Need some help with matlab?

Hi, How would I go about writing a function in matlab that outputs an array of amplitudes for given times to produce a combined sine wave, when given arrays of freq, amp, phase and time. I have written some code that outputs the correct result: Fs =...

A function is an m-file. It's defined in the first line of the code: function [out1, out2, ...] = your...

Does MATLAB's new "portable C/C++ code directly from MATLAB" feature make it possible for us to write C programs in MATLAB first?

Does anyone have more information about it? Does this mean that we could write most of our C code using MATLAB first, and then run the MATLAB coder? (C is important for speed, but MATLAB makes displaying output and debugging much easier)

I watched the webinar on MATLAB coder last week. It should be uploaded soon here: http://www.mathworks...

Tony McDaniel at Quora

Related Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

• Got an issue and looking for advice? • Ask Solucija to search every corner of the Web for help. • Get workable solutions and helpful tips in a moment. Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.