Questions tagged [matlab]

For mathematical questions about MATLAB; questions purely about the language, syntax, or runtime errors would likely be better received on Stack Overflow. MATLAB is a high-level language and interactive programming environment for numerical computation and visualization developed by MathWorks.

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.

In addition, MATLAB is a proprietary product of MathWorks. This means that, unlike other GNU GPL open source languages, both programmers and users must own a valid software license for running MATLAB code. There are several open source alternatives to MATLAB, in particular GNU Octave, which offers bidirectional syntactic compatibility with MATLAB, Scilab, SciPy, and Julia.

You could think about posting your question on Stack Overflow. They've got plenty of questions/answers already there.

Some informative links that show up quite often in answers:

User Amro has created a user-script for Matlab Syntax Highlighting for Stack Overflow. Use this link to install it.

3165 questions
0
votes
0 answers

Taking snapshots of an animation in PDE toolbox in Matlab

I have solved a pde numerically in PDE toolbox and have can play an animation of the solution. I would like to make "snapshots" at certain time steps $t=0,\ t=0.25,\ \ldots,\ t=1$, but cannot find this functionality. Also I cannot find a way to save…
kathi_h
  • 59
0
votes
1 answer

Handling with an Error caused by using GARCH(1,1) in Matlab

I need help for handling with an error in matlab caused with the function estimate(garch(1,1),x') from the Economic Toolbox. My exercise is to predict values for value-at-risks by using garch(1,1)-models for discrete returns $R$ of share prices…
Manu
  • 103
0
votes
1 answer

Solving continuous algebraic Riccati equation using MATLAB

I'm working on passivity preserving techniques for frequency weighted model order reduction. In my case I have to solve an algebraic Riccati equation using MATLAB. But in MATLAB function reference the equation must be something like…
0
votes
2 answers

MATLAB - Too many output arguments error need help

I don't really know how to explain what I'm after without an example. I guess the title could be better but I'm not sure how to describe the issue. I've got the following function function [x,y] = f(z) z = 3; x = z.*[2;1]; y = z.*[1 2; 3…
0
votes
2 answers

What is the name of this data preparation?

I have a two-dimensional array ($569\times30$ double) which should be normalized using this formula: $x'_{ij} = \dfrac{x_{ij}}{10^h} $ What is the name of this normalization and how can I do that in Matlab? Edit: $h$ is depended on array entries, it…
0
votes
0 answers

Approximating derivative of numerical solution (using ode45) within event function

The issue I have is having to compute the derivative (in real time) of the solution produced by ode45 within the events function. Some pseudo-code to explain what I'm mean is, function dx = myfunc(t,x,xevent,ie) persistent xs persistent dx2 % xevent…
S.D.
  • 1,561
0
votes
1 answer

Resonant circuits in MATLAB

The task is about resonant circuits. $I(t)$ is the searched function and describes the chronological sequence of the amperage. In case of $ D:= \frac{1}{LC} -\frac{R^2}{4L^2} > 0$ you can describe $I(t) = Re \left( \frac{U_0}{L(-w^2 + \frac{R}{L}…
0
votes
2 answers

How to define in Matlab the function $f(x,y)=\left ( xy,x-y^2,3x-2y \right )$

I need to define the function $f(x,y)=\left ( xy,x-y^2,3x-2y \right )$, how can I do this in Matlab? Thanks!
Tina
  • 517
0
votes
1 answer

Matlab function with array input problem

My question is simple but I just don't understand. I just wanted to plot Scorer function which is $$Hi(x)=\int_0^\infty{\exp(xt-\frac{t^3}{3})}dt.$$ First I tried to write, for example, x=0:0.1:1. Then I write y = 1/(pi)*integral(@(s) exp(x*s…
0
votes
2 answers

Iterative matrix multiplication in Matlab

I am newbie Matlab user and I have a basic question for one of you. I have two matrix P and Q (both of them have size 10x10). How can I write this operation in MATLAB? $T_{1}=Q*P\\ T_{2}=T_{1}*P\\ T_{3}=T_{2}*P\\ \ldots\\ T_{n+1}=T_{n}*P$ In…
Lynx
  • 53
0
votes
0 answers

Simple solve in Matlab returns only one answer

The following is my code for solving a simple equation $$\sum_{n=1}^{10}100(1+x)^{4n}=5\cdot \sum_{n=1}^{5}100 (1+x)^{4n}$$ However, my code only returns one solution x=-1, assuming that I only want real solution. I know there is another solution…
Valia
  • 371
0
votes
0 answers

A list of positive matrices by MATLAB

What is the program (in MATLAB) which has an answer to the following question. Let $p$ be a prime number and $n$ be a natural number. We are just supposed to focus on $M_n(Z_p)$, the set of $n\times n$ matrices with entries in the field $Z_{p}$.…
ABB
  • 1,998
0
votes
1 answer

MATLAB: linear combination of matrices

I have $N$ matrices of the same dimensions $m$-by-$n$ which span some matrix-space. E.g. the canonical basis $E_{ij}$ where the $(i,j)$-th entry is one and all others are zero. Now would like to store them in one quantity, say a $m$-by-$n$-by-$N$…
rehctawrats
  • 607
  • 6
  • 16
0
votes
1 answer

Having trouble plotting a specific function

let $$A = \begin{pmatrix} 1 & 2 & 3 \\ 2 & 5 & 6 \\ 4 & 8 & 9 \\ \end{pmatrix}$$ I want to plot this function $\lambda\to||(\lambda I_3-A)^{-1}||$ and then point out the eigen values on the graph My try : since…
the_firehawk
  • 2,425
0
votes
1 answer

How to graphs this gibbs fourier in matlab

How does one plot $y=|x|$ in MATLAB?
Albert
  • 9