answersLogoWhite

0

MATLAB (Matrix Laboratory)

MATLAB is a software and a package to implement signal processing. Using this tool one can create and test various signals & systems. These signals and systems can be tested for various parameters and operations. The real time simulation of signals, images, audio and video are performed using MATLAB. Various programs, syntax, applications and uses of MATLAB and signal processing can be discussed in this category. As the need for signal processing is increasing day by day, there is a need for separate category.

570 Questions

How do you create a catapult simulation using matlab GUI?

% Definitions

R2D = 180/pi; % rad to deg

D2R = pi/180; % deg to rad

F2M = 0.3040; % feet to meter

m = 45.46; % kg

g = -9.8; % gravity (m/s^2)

j = sqrt(-1);

dt = 0.001; %1000Hz

R1 = 15*F2M; %m

R2 = 15*F2M;

% Initial conditions

xBall = [0; 0]; % theta/omega

% Machine initial conditions

Torque = (-1)*m*g*R1; % N-m

Pmotor = 1119000; % W

Tbreak = (4404 / 0.738)*2.3; % break torque in N-m

% Ball

I = m*(R1^2);

for launch=0:1:20

times_launched = launch + 1;

% Main loop

iter = 0;

for time=0:dt:1

% Index

iter = iter + 1;

% Torque generation and check

if( (xBall(2,1)) < ((Pmotor)/Tbreak) )

Torque = Tbreak;

else

Torque = (Pmotor)/xBall(2,1);

end

% From 0 degrees to 90 degrees

if ((xBall(1,1)*R2D) >= 0 ) ((xBall(1,1)*R2D) < 90)

% Calculate net torque

Tgrav = ( m*g*cos(xBall(1,1)))*R1;

Tnet = Torque + Tgrav;

% Calculate instantaneous angular acceleration

alphaB = Tnet/I;

% Calculate the derivative of the state

xdot = [ xBall(2,1); alphaB ];

% Integration of the state

xBall = xBall + xdot*dt;

% Dependent states

pBall = R1*( cos(xBall(1,1)) + j*sin(xBall(1,1)) );

vBall = xBall(2,1) * R1;

Power = (Tnet/R1) * vBall;

elseif ( ((xBall(1,1)*R2D) >= 90) ((xBall(1,1)*R2D) <= 180) )

% Calculate net torque

Tgrav = ( m*g*cos( xBall(1,1)) )*R1;

Tnet = Torque + Tgrav;

% Calculate instantaneous angular acceleration

alphaB = Tnet/I;

% Calculate the derivative of the state

xdot = [ xBall(2,1); alphaB ];

% Integration of the state

xBall = xBall + xdot*dt;

% Dependent states

pBall = real(vBall) * time;

Power = (Tnet/R1) * vBall;

end;

DATA(iter,:) = [ iter time xBall' alphaB Tnet xBall(1,1)*R2D ...

real(pBall) imag(pBall) real(vBall) imag(vBall) vBall Power ];

end;

end;

%% Trajectory of Projectile (y vs. x)

figure(1);

plot( DATA(:,8), DATA(:,9), '.' );

title ('Trajectory (y vs. x) of projectile during launch')

xlabel('x')

ylabel('y')

%% Range (x) vs. time

figure(2);

subplot (211), plot(DATA(:,2), DATA(:,8), '.' );

title ('Range(x) as a function of time')

ylabel('Range(x)')

%% Altitude (y) vs. time

subplot (212), plot(DATA(:,2), DATA(:,9), '.' );

title ('Altitude(y) as a function of time')

xlabel('time')

ylabel('Altitude(y)')

%% Velocity (x and y components) vs. time

figure(3);

subplot (211), plot(DATA(:,2), DATA(:,10), '.' );

title ('Velocity (x and y) as a function of time')

ylabel('Velocity(x)')

subplot (212), plot(DATA(:,2), DATA(:,11), '.' );

xlabel('time')

ylabel('Velocity(y)')

%% Velocity (total) vs. time

figure(4);

plot(DATA(:,2), DATA(:,12), '.' );

title ('Velocity(total) as a function of time')

xlabel('time')

ylabel('Velocity (total))')

%% Power vs. time

figure(5);

plot(DATA(:,2), DATA(:,13), '.' );

title ('Power as a function of time')

xlabel('time')

ylabel('Power')

How do you convert a roman numeral into decimal using matlab?

x=input('Enter the roman numeral: ','s');

l=length(x);

for(i=1:l)

if(x(i)=='I')

a(i)=1;

elseif(x(i)=='V')

a(i)=5;

elseif(x(i)=='X')

a(i)=10;

elseif(x(i)=='L')

a(i)=50;

elseif(x(i)=='C')

a(i)=100;

elseif(x(i)=='D')

a(i)=500;

elseif(x(i)=='M')

a(i)=1000;

else

disp('Not a valid entry');

end

end

d=a(l);

for(i=l:-1:2)

if(a(i)>a(i-1))

d=d-a(i-1);

elseif(a(i)==a(i-1) a(i)<a(i-1))

d=d+a(i-1);

end

end

disp('The decimal equivalent is: ');

disp(d);

High definition signal analog tv?

A number of years ago, in the early days of consumer HD television there was an analog high definition component signal format available. Since then, manufacturers and content publishers have agreed that HDMI is the only HD interface to be available on equipment. Although the signal interface also carries audio and other data on a single cable, it does not benefit the consumer.

It is unlikely that any other analog interface will become available for HD signals.

There are a number of adapters that can accept HDMI signals and deliver an analog signal, normally in the form of a VGA signal. Some work better than others but many can be adversely affected by HDCP (High bandwidth Digital Content Protection) which can prevent the signals being converted to their analog form.

Unit ramp in matlab?

This following loop creates a unit ramp input :

for t= 0:0.1:5

if(t<=1)

y(count) = t;

end

if(t>1)

y(count) = 1;

end

Rz(count) = tf(y(count)*T,[1 -2 1],T);

Rs(count) = d2c(Rz(count));

end

% T = 0.005; this is for a discrete system

How do you publish an image to google images?

I just read this somewhere else, but I'm pretty sure you need an app (kike Picasa) which is the only way I can find. Sorry!

What is global threshold in image processing?

Global thresholding is a method used in image processing to segment an image into foreground and background regions based on a single threshold value. It involves selecting a threshold value that separates pixel intensities into two classes, typically using a histogram of the image intensities. Pixels with intensities above the threshold are classified as foreground, while those below are classified as background.

What are the advantages of matlab over c languages?

  1. Ease of Use
  2. Platform Independence
  3. Predefined Functions
  4. Device-Independent Plotting
  5. Graphical User Interface (GUI)
  6. MATLAB Compiler

How do you watermark an image in MATLAB?

A sigital Watermarking example in Matlab is in related links.

How would I add numbers input by a user one at a time into a vector in MATLAB I have the loop set up but don't know how to add the data into the vector?

First, make sure your vector is initialized outside of the loop. Then, within your loop you need to update the vector. If you want data entered by the user only, you should initialize with an empty vector.

Example program (not sure which loop you're using, but I'll use a while loop here):

vector=[];

user='y';

while user=='y'

user=input('Enter another variable? Type y for yes and n for no: ');

if user=='n'

break

end

var=input('Please input variable: ');

vector=[vector, var];

end

The key part in this coding is the line:

>> vector=[vector,var];

as this will update your vector with the previous vector values, and then add another value to the vector with whatever number var is.

Hope this helps!

Where can one find a Matlab Tutorial?

If you are looking for a Matlab tutorial, you can try websites such as Mathworks, or Stackoverflow. You might also contact your local schools to get more information as well.

What is mean by signal?

Signal is the electrical(discussion is confined to electrical domain only) quantity which varies between two levels and holds some useful information.

Which is the function of matlab?

matlab stands for matrix laboratory..

the function of matlab to create different types of signal and observe them .and their are so many different functions of matlab like,

simulink fuzzy logic,simply arithmetic ,GUI etc

What is image acquisition in image processing?

Its name specifies definition. To get image from any source especially hardware based any source is called as image acquisition in the image processing because without image receiving/acquisition, the processing on the image is not possible. It is the first step in the workflow.

Segmentation image by GA plus source code Matlab?

Dear My friend

I am Diem

my Email: buitrongdiem@gmail.com

I am writing programming GA code matlab

but I do not know association objective function and constraint condition

Can you say for me method association it ?

Thanh you ve re much!!!!

Best Regard

BuiDiem

What is image processing?

Image Processing is area in which image is processed based on pixel (spatial) and frequency methods.

In spatial method pixel value are subject to change

For more details on image processing research visit

http://imageprocessing.webs.com/

Where can one get a pawprint image?

One can get a pawprint image from various sources. A few options include searching for free images on websites like Pixabay or Unsplash, creating a custom pawprint design using graphic design software, or even using a pawprint stamp or stencil to create the image manually. Another possibility is reaching out to a professional designer who can create a custom pawprint image for you.

What is filter in digital image processing?

A filter is an effect that can be added to an image that affects the overall appearance, or apearance of a selected area, of an image.

What are the applications or uses of matlab?

  • Data Exploration ,Acquisition ,Analyzing &Visualization
  • Engg drawing and Scientific graphics
  • Analyzing of algorithmic designing and development
  • Mathematical functions and Computational functions
  • Simulating problems prototyping and modeling
  • Application development programming using GUI building environment.