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?

Answer:

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

Read more

Spender at Stack Overflow Mark as irrelevant Undo

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?

Answer:

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

Read more

mza at Yahoo! Answers Mark as irrelevant Undo

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...

Answer:

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

Read more

mei at Yahoo! Answers Mark as irrelevant Undo

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?

Answer:

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

Read more

Ken Meltsner at Quora Mark as irrelevant Undo

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...

Answer:

b=a[:,:]

Read more

ashvin a at Yahoo! Answers Mark as irrelevant Undo

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 &...

Answer:

http://www.youtube.com/watch?v=wyx6JDQCs…

Read more

Walt P at Yahoo! Answers Mark as irrelevant Undo

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...

Answer:

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

Read more

xman-ga at Google Answers Mark as irrelevant Undo

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 =...

Answer:

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

Read more

jjasso5 at Yahoo! Answers Mark as irrelevant Undo

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)

Answer:

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

Read more

Tony McDaniel at Quora Mark as irrelevant Undo

Related Q & A:

Just Added 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.