Questions tagged [matlab]

MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks. Don’t use both the [matlab] and [octave] tags, unless the question is explicitly about the similarities or differences between the two. When using this tag, please mention the MATLAB release you're working with (e.g. R2017a).

MATLAB (Matrix Laboratory) is a high-level language and interactive programming environment for numerical computation and visualization, developed by MathWorks. MATLAB can be used when performing tasks such as signal processing and communications, image and video processing, computational finance, and computational biology. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend its core capabilities.

MATLAB is a cross-platform system developed since 1984. From the release of version 7.2 (R2006a) there has continued to be a biannual release cycle, with version "a" typically released in March/April and version "b" in September/October - based on the release history. For example R2017a and R2017b were the two releases in 2017.

MATLAB is a proprietary product of MathWorks. This means that, unlike open source languages, both programmers and users must own a valid software license in order to run MATLAB code.

There are several open source alternatives to MATLAB, in particular GNU Octave, which offers (mostly) bidirectional syntactic compatibility with MATLAB, Scilab, SciPy, and Julia.

Documentation

Informative links that show up quite often in answers##

  • Release notes for all versions.
  • MATLAB Central File Exchange: a repository of user-contributed MATLAB tools
  • MATLAB Add-Ons: Add-Ons for MATLAB
  • MATLAB Central blogs: usually updated weekly by a number of MathWorks employees
  • Undocumented MATLAB: "Charting MATLAB’s unsupported hidden underbelly"
  • MATLAB Answers: a collaborative environment for getting answers to questions about MathWorks products, similar to Stack Overflow
  • comp.soft-sys.matlab Usenet group: can be accessed online through Google Groups
  • MATLAB Cody™ is a place where you can go to find a variety of MATLAB-based coding challenges that will help to expand your understanding of MATLAB.
  • MATLAB ThingSpeak™ is an open data platform and API for the Internet of Things that enables you to collect, store, analyze, visualize, and act on data gathered directly from sensors or from other web sources. With ThingSpeak and its built-in MATLAB Analysis and MATLAB Visualizations apps, you can create custom trends and plots.
  • MATLAB Online: Online version of MATLAB (available to licensed users only). Octave Online is a free alternative based on the open source GNU Octave which is (pretty much) compatible with MATLAB.
  • MATLAB on Stack Overflow chat: Chat room for users of MATLAB and Octave
94593 questions
10
votes
3 answers

calculating a function in matlab with very small values

I am making a function in matlab to compute the following function: for this function we have: This is my implementation in matlab of the function: function [b]= exponential(e) %b = ? b= (exp (e) -1)/e; When I test the function with very small…
franvergara66
  • 10,524
  • 20
  • 59
  • 101
9
votes
5 answers

How can I find equation of a plot connecting data points in Matlab?

I have various plots (with hold on) as show in the following figure: I would like to know how to find equations of these six curves in Matlab. Thanks.
user238469
9
votes
2 answers

Matlab, automatically delete the index variable after the execution of a loop

On Matlab, when i am using a "for...end" loop, the indexing variable still exists in my workspace after the loop have been fully executed. I would like it to be automatically deleted, since its not relevant anymore outside of the loop and that it…
Mesop
  • 5,187
  • 4
  • 25
  • 42
9
votes
4 answers

Why fourier transform is not possible on color images?

Why fourier transform(dft) is not possible on color images? Why only on gray scale images Fourier transforms is possible?
siddharth
  • 579
  • 1
  • 8
  • 18
9
votes
4 answers

how to display dicom image in matlab?

I want to ask about this function in matlab dicomread example : a = dicomread ('m.dcm'); imshow(a) the image showed in the screen but it is very dark.....I wonder way it is dark and not normal. I checked with different dicom images but the problem…
user-x
  • 139
  • 2
  • 2
  • 8
9
votes
4 answers

remove empty cells in MATLAB

I want to remove all empty cells at the bottom of a matlab cell array. However all code example that I found collapse the matrix to a vector, which is not what I want. So this code a = { 1, 2; 3, 4; [], []} emptyCells = cellfun('isempty', a);…
Matthias Pospiech
  • 3,130
  • 18
  • 55
  • 76
9
votes
2 answers

MATLAB FFT xaxis limits messing up and fftshift

This is the first time I'm using the fft function and I'm trying to plot the frequency spectrum of a simple cosine function: f = cos(2*pi*300*t) The sampling rate is 220500. I'm plotting one second of the function f. Here is my attempt: time =…
Jean-Luc
  • 3,563
  • 8
  • 40
  • 78
9
votes
6 answers

Matlab size of image

I am trying to find the size of an image I have loaded into matlab. image=imread('text.jpg'); [x,y]=size(image); This return the error: Indexing cannot yield multiple results. Does imread not read the image into a 2d array, which should therefore…
Joseph
  • 2,706
  • 6
  • 42
  • 80
9
votes
2 answers

Matlab in Linux (Ubuntu 11.10) doesn't display Unicode (Hebrew) in plot figure

I try to use Hebrew characters in a Matlab figure plot on my Ubuntu to no avail. I tried: text(0.6,0.5,'ירוק','fontname','times new roman','rotation',180,'fontsize',50,'color','r') and title('ירוק','fontname','times new…
Yuval
  • 3,207
  • 32
  • 45
9
votes
2 answers

Are Matlab Matrices transferred pass-by-value or pass-by-reference?

I'm new at Matlab. You may find this question silly but I really wonder if the statement below is a pass-by-value operation or pass-by-reference operation. I = imread('logo.png'); binaryImage = im2bw(I, 0.4); Itemp = binaryImage; Does the Itemp is…
Yunus Eren Güzel
  • 3,018
  • 11
  • 36
  • 63
9
votes
1 answer

Automatic Face Detection Using MATLAB

I am trying to implement automatic face detection using MATLAB. I know how to implement it using OpenCV, but i would like to do it in MATLAB. I saw two websites on this: 1) http://www.mathworks.com/matlabcentral/fileexchange/11073. Firstly, this…
lakshmen
  • 28,346
  • 66
  • 178
  • 276
9
votes
4 answers

Passing and saving anonymous function in matlab

I would like a function (for example, a fit function) to return an anonymous function (usually stored in a struct) that I can save and use later. However, passing @func tends to pass a function pointer rather than the function itself. Is an inline…
emarti
  • 172
  • 2
  • 8
9
votes
2 answers

Shape Recognition - counting mangoes

I would like to be able to process a close-up image of a mango tree so that I can identify and count the mangoes. A mango is roughly an oval or ellipse shape that is uniquely different from the leaves and branches in the image. I would like to be…
9
votes
3 answers

How can I load large files (~150MB) in MATLAB?

I have a large MATLAB file (150MB) in matrix form (i.e. 4070x4070). I need to work on this file in MATLAB but I can't seem to load this file. I am getting an "out of memory" error. Is there any other way I can load this size of file? I am using…
user1188217
  • 91
  • 1
  • 2
9
votes
3 answers

How do I append metadata to an image in Matlab?

In writing some image processing routines in Matlab, I found that I don't know how to write metadata in to a newly processed and saved image. To keep it simple, my flow is as follows: image = imread('Base_Pic.jpg'); image_info =…
zachd1_618
  • 4,210
  • 6
  • 34
  • 47
1 2 3
99
100