Top "Matlab" questions

MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks.

How to show legend for only a specific subset of curves in the plotting?

t = 0 : 0.01 : 2 * pi; s = sin(t); c = cos(t); m = -sin(t); hold on; plot(t, s, 'r'); plot(t, c, …

matlab plot legend
Custom x-axis values in a matlab plot

Currently when I plot a 9 by 6 array, the x-axis of the figure is just 1, 2, 3 up to 9. The Y-axis shows the …

matlab plot axis octave figure
How can I convert a color image to grayscale in MATLAB?

I am trying to implement an algorithm in computer vision and I want to try it on a set of …

matlab colors image-manipulation grayscale
How to make a Gaussian filter in Matlab

I have tried to make a Gaussian filter in Matlab without using imfilter() and fspecial(). I have tried this but …

image matlab gaussian
Can someone either point me to an online/free MATLAB compiler/interpreter or explain what happens in this MATLAB code?

I apologize in advance for this question. I don't like "explain this code" questions, but I can't find any documentation …

matlab matlab-compiler
How to save MATLAB figure as JPEG using saveas() without the image coming off badly?

In a MATLAB function I am writing, I am generating a figure. The figure is displayed when the function is …

matlab matlab-figure
Matrix of unknown length in MATLAB?

I'm trying to set up a zero matrix of variable length with two columns into which I can output the …

matlab matrix variable-length
Performance Tradeoff - When is MATLAB better/slower than C/C++

I am aware that C/C++ is a lower-level language and generates relatively optimized machine code when we compare with …

c++ c performance matlab
Normalization in variable range [ x , y ] in Matlab

I wanna create basic matlab program that normalizes given array of integer in the given range. Inputs are an array [ …

matlab normalization
Solving matrices of the form Ax = B ==> error: Matrix is close to singular or badly scaled

I'm having trouble solving a system of the form Ax=B The solution to the system should be x = inv(…

matlab linear-algebra