Questions tagged [matlab]

MATLAB is a high-level language and interactive programming environment developed by MathWorks. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend the core capabilities.

MATLAB is a high-level language and interactive programming environment developed by MathWorks. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend the core capabilities.

Some informative links that show up quite often in answers:

34 questions
25
votes
6 answers

Surviving MATLAB and R as a Hardcore Programmer

I love programming in languages that seem geared towards hardcore programmers. (My favorites are Python and D.) MATLAB is geared towards engineers and R is geared towards statisticians, and it seems like these languages were designed for people…
dsimcha
  • 17,224
  • 9
  • 64
  • 81
16
votes
7 answers

Is there a recommended way to communicate scientific/engineering programming to C developers?

I have a lot of MATLAB code that needs to get ported to C (execution speed is critical for this work) as part of a back-end process for a web application. When I attempt to outsource this code to a C developer, I assume (correct me if I'm wrong) few…
gkdsp
  • 497
  • 4
  • 11
15
votes
3 answers

Implementing technical paper algorithms in C++ or MATLAB

I am an Electrical Engineering undergrad. I've reading many technical papers about Signal and Image processing algorithms (reconstruction, segmentation, filtering, etc). Most of the algorithms shown in these papers are defined over continuous time…
Damian
  • 259
  • 1
  • 4
10
votes
5 answers

Moving to Python (SciPy and NumPy) for Scientific Computing

Just read a presentation about using Python for Scientific Computing. I am currently using MATLAB (student license FTW, which will expire when I graduate soon). So I was wondering how matured SciPy and NumPy are with respect to relying on them for…
notthetup
  • 211
  • 1
  • 2
  • 7
10
votes
4 answers

Why are scientific programming languages so weird?

It seems to me that programming languages meant for use in science and engineering are consistently weird compared to general-purpose languages. Some examples off the top of my head: In Matlab, each function has to be placed in a separate file In…
haroba
  • 225
  • 2
  • 3
8
votes
7 answers

How to explain OOP to a matlab programmer?

I have a lot of friends who come from electrical / physical / mechanical engineering background, and are curious about what is "OOP" all about. They all know Matlab quite well, so they do have basic programming background; but they have a very hard…
Oak
  • 5,215
  • 6
  • 28
  • 39
7
votes
2 answers

Is there something peculiar to Matlab or Mathworks that supports so much "undocumented" code?

I've been drilling into a lot of Matlab recently trying to interface with an in house algorithm engineer's work to modularize it for use in a test bench outside his suite of applications. I've come across several links from several different areas…
jxramos
  • 359
  • 1
  • 9
5
votes
1 answer

Best practice for grouping related constants

I'm working on Finite Element code in MATLAB, and the number of constants (for instance user input defining the geometry, physics, numerical solution scheme) is substantial. Currently, I've been passing variables between subroutines using global…
5
votes
1 answer

In MATLAB, how can 'preallocating' cell arrays improve performance?

I was reading this article on MathWorks about improving MATLAB performance and you will notice that one of the first suggestions is to preallocate arrays, which makes sense. But it also says that preallocating Cell arrays (that is arrays which may…
Alex McMurray
  • 153
  • 1
  • 4
4
votes
5 answers

Lines of Code vs. Optimal Language

I was wondering whether it is possible to give any advice as the the maximum number of lines of code at which one should consider switching from say MATLAB to a more low level language? Is it even the case that at a certain point it makes more sense…
PeeJay
3
votes
0 answers

Avoiding global variables by using persistent variables in MATLAB

Disclaimer: Although I mention my use in matlab I think this is is more of a programming pattern question so I put it here. If I am incorrect I will be happy to go over to stackoverflow. I have a variable comprising of strings array which acts like…
rick_2047
  • 31
  • 1
3
votes
0 answers

Rotation logic for MNIST Handwritten Digit Dataset

I am currently applying some pre-processing to this dataset. Some of the digits are extremely rotated and I would like to know how others managed to get them 'upright'. I have implemented something on matlab which finds the difference between (most…
3
votes
2 answers

User Inputs: Bounding Box, best practice?

I am creating a function in matlab that takes in two lat/long coordinates (opposite corners of a rectangle) and returns information about data in the region. How do I group my inputs? e.g. [lat1,long1] and [lat2,long2]; or [lat1,lat2],…
tenwest
  • 131
  • 4
3
votes
1 answer

Plotting electrical field lines on a 2d plane

How do you plot equipotential electrical field lines on a 2d plot in MATLAB. Would it be best to use either quiver or contourf? Some example points are: p1 = (1,1) with 1 coulomb charge. p2 = (2,2) with 2 coulomb charge. p3 = (3,3) with 3 coulomb…
Firo Proncho
  • 39
  • 1
  • 1
  • 2
3
votes
1 answer

Where does test fixture code fit in?

This is an unusual question since I don't believe it lends itself to typical software development practices but I hope you can prove me wrong. In MATLAB, my team have created several signal processing components, where data goes in one end, and…
Sam Delaney
  • 209
  • 1
  • 4
1
2 3