Wednesday, June 10, 2009

Matlab Basics : dealing with arrays

Matlab is so powerful at handling arrays. It can generate lots of different kind of arrays, take one or some of specific elements in array and change the value of the elements. Since the data and files saved in computer are all basically 0 and 1, I guess that every file in the computer can be interpreted as certain kind of array, and thus can be accessed and edited by Matlab. (Of course, it's my GUESS.)

How to generate array using Matlab?

mauanlly input: A1=[1 NaN 3; 4 NaN 6; 7 NaN 9] % NaN means Not a Number.
use functions:

A2=magic(3) % magic array
A3=zeros(3) % all elements are0
A3=ones(3) % all elements are 1

3 comments:

  1. Another useful MATLAB function is repmat(). repmat() generates a repeated array:

    >> X = [1 2 3]

    X =

    1 2 3

    >> repmat(X,[3 2])

    ans =

    1 2 3 1 2 3
    1 2 3 1 2 3
    1 2 3 1 2 3

    ReplyDelete
  2. You can get some latest computer tips, blogging tips and internet tips in the blog TechnTechie.

    ReplyDelete

Any comments?

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...