Matlab Definition and 1000 Threads

  1. L

    MATLAB Producing arrays to plot (MATLAB)

    Hi everyone, my code is a little rusty and a work in progress but I was wondering how I would go about producing arrays for the calculations performed in the while loop for the analyses so they can be plotted. I have the following parameter input; G0 = 50; v = 0.25...
  2. M

    MATLAB How Can Lifting Line Theory Be Applied in MATLAB for Aircraft Wing Design?

    Hi guys, I am studying aerospace engineering doing my final year. I am doing my final year project which is called "Development of Aircraft Wing Design Tool using MATLAB". It is basically to create a basic tool which will help a designer to design wings. I am totally confused on how to go...
  3. D

    MATLAB Using Matlab to plot a phase potrait for ODEs

    First create the function file and name it whatever you would like. I prefer phase-portrait. % Phase Plot Program % To use this function, do the following: % >> phase_portrait(x1, x2, y1, y2, tfinal, 'F', N); for example, % >> phase_portrait(-5, 5, -5, 5, 10, 'F', 5)function [] =...
  4. E

    How i can plot anti periodic sine wave in matlab ?

    i don't know how i can use MATLAB to plot anti periodic fun .. the origin site give this code for triangular fun: fs = 10000; t = -1:1/fs:1; x1 = tripuls(t,20e-3); plot(t,x1), xlabel('Time (sec)');ylabel('Amplitude'); title('Triangular Aperiodic Pulse') but when i use this for sine...
  5. C

    Plotting Multiple Equations on One Graph in MATLAB?

    Homework Statement Does anyone know how to do this? Let's say I had the equation: f(t) = |2t, 0≤ t < 2 |(t^2)-3, 2≤t how would you plot this over 0≤ t ≤4 in Matlab? Homework Equations - The Attempt at a Solution I've tried ezplot but i can't manage getting both...
  6. C

    Plotting Fourier Functions in Matlab - Help?

    Plotting Laplace Functions in Matlab - Help? SORRY I MEANT LAPLACE FUNCTIONS Homework Statement so we have a function f(t) = |2t, 0≤ t < 2 |(t^2)-3, 2≤t how would you plot this over 0≤ t ≤4 in Matlab? Homework Equations - The Attempt at a Solution I guess you could...
  7. R

    MATLAB Nation of Tool Users? ( ex. Matlab)

    Sometimes I get the impression that employers want a. Experience in a particular software tool AND b. Specialization and this trumps everything else other than work experience. It wasn't unsual for people with no formal educational background in Computer Science to land programming jobs...
  8. L

    Lighter matlab descrete convolution software

    A while back I tended a course in transform methods. During the course we were handed a MAtlab program that could be used to simulate convotution called Discrete Convolution Demo. It's kind of big or you might say bloated and I'd like some lightweight version or something. If someone know some...
  9. G

    Question about square brackets and parentheses in MATLAB.

    I'm trying to figure out what these do in certain implementations. I can't seem to find the answer in the documentation. http://www.mathworks.com/matlabcentral/fileexchange/30580-binary-amplitude-shift-keying[1] for ii = 1:1:length(bit_stream) ASK_signal = [ASK_signal...
  10. P

    MATLAB Download MATLAB for Free - Before Uni Starts

    How can I download MATLAB for free? Uni starts soon and I want to get the program before that. Can you help me please? Thanks :)
  11. T

    MATLAB How can I isolate a segment of ECG data in MATLAB?

    I have inputed the following, I was given a signal and told to plot it in a time domain. The signal ECG is a data file and imported. N = 15000; fs = 250; t = linspace(0, 60, N); %signal = ecg data = ecg subplot (2,1,1); plot (t,ecg); title ('Time-Domain ECG') xlabel ('Time (s)') ylabel...
  12. H

    MATLAB Matlab: Butterworth Filter Bode Plot

    I'm stuck on a really simple problem because I haven't done MATLAB in a while. I have transfer functions for nth order lowpass Butterworth Filters: H(jw) = 1/(s + w_c)^n I want to plot the 1st to 5th order filters. How do I input H(jw) into matlab? The tf(num, den) is not efficient in that...
  13. J

    How Do I Correctly Plot an Electric Field Around a Base Station Using MATLAB?

    Homework Statement I need to plot an electric field in some range around base station, for example in range of 200m. EIRP=57,5dBm G=1 for the first example N=4 Homework Equations E=[2*sqrt(30*N*P*G)]/r P=10exp[(EIRP-30)/10] EIRP=57,5dBm G=1 for the first example N=4 The...
  14. S

    MATLAB MATLAB num2str: Preserving Valid Digits

    Dear Users, the topic MATLAB num2str is closed, therefore I am posting this as a reply to that thread. The suggestion by marcusl won't work for numbers of various format, but same number of valid digits. Example: The numbers 0.0056 0.0060 0.043 0.050 0.32 0.40 are valid to their...
  15. P

    Convolving a signal with its impulse response in MATLAB

    Homework Statement We're supposed to convolve the signal x[k] = u[k] - u[k-8] with its impulse response h[k] = sin(pi*k/4)*( u[k] - u[k-8] ) with the help of MATLAB. Homework Equations - The Attempt at a Solution The thing is that we don't know how to do this in MATLAB...
  16. N

    MATLAB Importing Data in MATLAB: Plotting Time vs. Third Column

    Hi. Suppose I load data from a .csv file: Blah @Blah 2Blah Blah f Blah fa Blah Blahasd Blahasda vasf Blah as Blah asdas Blah Date Time Ch1: 07/25/2012 42:46.0 96.385 07/25/2012 42:46.0 -177.608 07/25/2012 42:46.0 155.481 07/25/2012 42:46.0 64.15 an attempt would be to...
  17. C

    MATLAB Creating a MATLAB Function File Without Mod/Rem

    I need to create a MATLAB function file that will accept a modulo values (from 3 to 9; that is Z3 to Z9) and will output the least possible value describe by the modulo conditions I don't know how to start it because I am not allowed to use the mod() and rem(). Please give me an idea how to do...
  18. M

    MATLAB Matlab code natural numbers subset

    I have array of natural numbers from 1 to n. They are divided into m groups, where m*(m-1)=n. I need all m-1 elements from first group, last m-2 elements from second group, last m-3 elements from third group...zero elements from last group. For example 5*4=20: 1,2,3,4; 5,6,7,8...
  19. M

    MATLAB Spliting a line segment into desired length segments (Matlab)

    Hi Guys, I don't know if I make sense but please try to help me. I am working in Matlab. I have multiple line segments of different lengths with end point coordinates. I want to split each major segment into multiple minor segments in a way that all segments will have same length...
  20. I

    Please help my for loop goes on forever (Matlab) :/

    Homework Statement Question: A ball is launched from a height of 12m. It should land in a pool that has a length of 22m and is 9m away from the wall. Find the minimum and maximum initial velocities for the ball to land in the pool. The ramp is angled at 1 radian such that vy = 0.54v and vx =...
  21. D

    MATLAB Matlab Difference Equation Loop?

    Trying to make a three line loop that would differentiate x2√4x+1 to the nth term starting from the original function (n=0) to the 5th derivative (n=5) and then substitute 2 into the derivatives. Here's what I got f = @(x) x2√4x+1 For n=[0:5] - As the nth term goes from 0 to 5...
  22. S

    MATLAB Help needed in MATLAB , Please ( Simple question )

    hello everybody ! I'm working on a simple MATLAB program & I got stuck with something so I'll appreciate it if anyone can help how can I write an imaginary value in a MATLAB program as input , for example, impedance Z = 100+10i
  23. K

    MATLAB Matlab fprintf % usage in output data

    Matlab fprintf "%" usage in output data I want to save data into a textfile, but I will again need MATLAB to read that text file, in which case, I would like to have my header-text of the data table begin with '%" so that when I am reading from than file, MATLAB will ignore header. I am...
  24. S

    MATLAB MATLAB function that estimates pi

    I have to write a MATLAB function that estimates the value pi based on the fraction of a collection of random points in the square [1; 1] that are within the circle of radius 1 centered at the origin. I am very new to MATLAB and computer science in general and I've been having a great deal of...
  25. H

    MATLAB MATLAB fprintf(): Create Table of Height & Distances Earth & Mars

    I'm trying to create a table with three separate columns using fprintf(). The first column consists of a height vector h = 0:500:10000 and the second and third columns are part of the matrix Distance. I've tried looking online and I can't seem to find a way to make the vector and the matrix...
  26. O

    Orbit of satellite 2nd order ODE using Matlab

    Hi, I am completely stuck on this problem that has been given to us. I must solve a set of 2nd order differential equations using Euler's method. It is for a geosychronous orbit of a satellite, meaning the orbit is circular and the velocity vector is perpendicular to the radius vector...
  27. N

    MATLAB Is it Possible to Solve a Coupled System of ODEs with ODE45 in MatLAB?

    Hi I am trying to solve a simple set of coupled ODE's by ODE45. The coupled system is given by: function xprime = eoms(t, x) xprime = [ 1e9 + 5.0e4*x(3) - 50*x(1); 4.0e1*x(1) - 3.3e3*x(2); 2.0e3*x(2) - 5e4*x(3) + 3.5e7*heaviside(t-1)*x(4); 1.0e3*x(2) -...
  28. H

    MATLAB Different correlation coefficient results between Matlab and Excel.

    Different correlation coefficient results between Matlab and Excel. Please Help! I have two sets of dat as below. A problem is that MATLAB and excel returns a different value of correlation coefficient (i.e., 0.801 from Excel and 0.786 from Matlab). For Matlab, I used the function...
  29. A

    MATLAB Storing Iteration Results in Matlab

    Dear All, Please help me on this little problem. I have the code below. for k=40:10:80 T(k)=273.15+k; z=[0.2 0.2 0.2 0.4]; W_PR=0.245; C=4; omega=[0.344 0.467 0.578 0.789]; Tc=[600 700 500 570]; Pc=[50 70 58 76]; for c=1:C...
  30. A

    MATLAB (quick) Matlab fprintf question

    I have output (stored in variable "x") that I want saved into a simple text file. If I use the command: fprintf('%d\n',x); it prints the data in a nice column. This is what I want. Then to save it to a file I try this: fileID = fopen('x.txt'); fprintf('%d\n',x); fclose(fileID)...
  31. Angelos K

    MATLAB Why are there saw-teeth on my Matlab eps prints?

    Dear all, I generate some MATLAB figures that I want to print as eps. The figures look fine in the .fig format. When I open the eps, there is a problem. Wherever there is a vertical line (or part of function) the line shows tiny saw-teeth. I would like to attach I file but it seems one can't...
  32. M

    MATLAB Plot unit circle in chebychev metric in MATLAB

    Ok, so I'm trying to plot the unit circle using the chebyvhev metric, which should give me a square. I am trying this in MATLAB, using the 'pdist' and 'cmdscale' functions. My uber-complex code is the following: clc;clf;clear all; boundaryPlot=1.5; % Euclidean unit circle for i=1:360...
  33. N

    MATLAB MATLAB: Plotting a Circle from Unordered Data Points

    Hi I have a dataset which traces out a circle. The issue is that the data points are not ordered, so if I plot the set and make lines between adjacent (= "adjacent" in the sense that they are next to each other in the dataset) data points, then the plot does not look like a circle. Is...
  34. H

    MATLAB Calculating Distances with MATLAB's For Statement

    Hello Guys Can you please tell me whether this code is correct or not?? this code use to calculate all distances from A to J points on the map ( has longitude and latitude ), the starting point coordinates ( Lat and Long ) is 3.682043 and 101.523710 and the destination is 2.227804...
  35. R

    MATLAB MATLAB - Using solution of one ODE in another

    Hi all, I'm trying to use MATLAB to obtain simulations for some equations that describe a model. I'm new to MATLAB (though I've taken a course in C++ and another in Java), so I read a bit on the mathworks website on solving ODEs, and settled on [FONT="Courier New"]ode45 The equations I'm...
  36. M

    MATLAB: How do you find the lagrange multipliers

    When I try to solve a linear program using matlab,after using linprog(f,A,b,...) I can find the Lagrange multiplier associated with the inequality constraints and the lower bound constraints by using: lambda.ineqlin ; lambda.lower But if I want to solve a quadratic program (using...
  37. F

    MATLAB Add Packages to MATLAB for Higher Order Arithmetic

    Basically I'm writing my MSc dissertation right now, and I've been doing a lot on primes I've written all my code in MATLAB, but my supervisor told me today that MATLAB is crap for higher order arithmetic and the primes only go up to something like 10 digits long. SO I'm kinda screwed...
  38. S

    MATLAB How to pass a variable input into a function in matlab?

    I have an ode function which is of the form: function [output]=Fun[input1,input2,input3] which is solving a set of non-linear differential equations. input1 and 3 are fixed but input2 is a variable. Say: input1=3; % a constant input3=20; input2=[2 4 6 8]; function Fun is being...
  39. B

    MATLAB Troubleshooting MATLAB Functions and Variables

    i have a question. i just try to learn MATLAB however i couldn't define the functions and variables inside the one script. i open new script file and give the function comment in it for example like this... function [ y ] = betaf( x,Ee) lambda=0.1; y=100*gammaf(Ee)*lambda/(2*pi*x)...
  40. M

    MATLAB Plotting the Fourier series in Matlab

    I am very confused on how to start this problem, would highly appreciate some help! Consider the function f(x)=   0, -1≤x≤0 2x, 0≤x≤1. The Fourier series coefficients for this function are given by [a][/0]=0.5, and for  k=1, 2, 3,...  ...
  41. M

    MATLAB Getting Started with MATLAB Simulations of Basic Equations

    Hello friends, I am new to MATLAB and I have been asigned a task in MATLAB to simulate basic equation.. I have no idea how to start.. The equation is Arterial pressure= Mean arterial pressure - h*7.46 (h= height) Can you tell me how to do please? thankx
  42. W

    MATLAB Calculate amplitude, phase and energy spectrum using FFT in MATLAB

    Hello all, I have a vector, let's say A, which has measured values of the Earth's magnetic field (and if it is relevant, two vectors X and Y with the coordinates of the point each value was measured). I need to calculate the amplitude, phase and energy spectrum using FFT in MATLAB X...
  43. M

    Deleting an entry from an array in MATLAB

    I want a code in MATLAB that produces A\{4}, where A={3,6,1,-3,4,8}. I know for instance: A=[ 3 6 1 -3 4 8]; A(5)=[]; produces 3 6 1 -3 8 But what should I do if I don't know the index (in this case 5) for the entry '4'; and I want to get [ 3 6 1...
  44. V

    MATLAB Generating covariance matrices as defined in MATLAB

    Hi, I'm fairly new to MATLAB and I was wondering if you guys could help me out. If I have an N*N matrix, C where the (k,l)-entry is defined as: http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash3/556394_10151031836051952_2120388553_n.jpg Where x_i is from an N-vector where x_i is normally...
  45. Y

    MATLAB Help: matlab max return wrong value?

    Hi, I am using MATLAB max to find maximum along dimension 4. However I must made some mistake because the returned value is not the maximum sometimes: ans = 142.1571 ---------------- Can someone please help? Thanks.
  46. S

    MATLAB Numbers greater than INF in matlab

    Hello all, I need to use numbers that are greater than 10e308 in matlab. Apparently, 52 bit MATLAB does not recognize them and uses INF instead of the big number. I googled for it and only got some vague answers how to deal with it (something about file exchange...).Help! please... thanks.
  47. N

    MATLAB Matlab - How to solve simultaneous non-linear differential equations?

    Matlab -- How to solve simultaneous non-linear differential equations? How to solve simultaneous non-linear differential equations in MATLAB m-file without using the commands?. can you give me the program?.
  48. S

    MATLAB Solving MATLAB Problem: Mark an X or Cross on a Plot

    hi everyone! I need to mark an X or a cross on a plot at a specific x-value. Any ideas how i can do this? Thank you!
  49. A

    MATLAB Is there a problem with adjusting the code for plotting climate data in Matlab?

    I have climate data that I am plotting in Matlab with a script. The relevant code for this problem, I think, is this: lon = reshape(grid_txt_lon,144,73); lon(lon>180) = lon(lon>180) - 360; lon = [lon(74:144,:);lon(1:73,:)]; lat = reshape(grid_txt_lat,144,73); deg =...
  50. M

    MATLAB How Does MATLAB Solve Linear Algebra Problems with Multiple Solutions?

    Hello, My question is to with a specific Linear Algebra problem being solved in MATLAB: [1 2]Y_I = 3 ------------ (i), Y_I1 > 0 , Y_I2 > 0; where Y_I = [Y_I1 Y_I2]^T is the unknown to be found in the above equation (^T stands for transpose of a vector). Let A_I = [1 2] and b= 3...
Back
Top