Matlab Definition and 1000 Threads

  1. N

    MATLAB Optimizing Taylor Series Approximations in Matlab for Trigonometric Functions

    I have been working on writing g a script file that will: Calculate f(x)=5sin(3x) using the Taylor series with the number of terms n=2, 5, 50, without using the built-in sum function.  Plot the three approximations along with the exact function for x=[-2π 2π].  Plot the relative true error...
  2. beyondlight

    MATLAB How to Check Computer Performance in Matlab?

    Hi. I have written some functions in Matlab and I would like to use them, the problem is that they require a lot of computations and hence takes a lot of time to calculate everything. I suspect that my computer may be slower than it should. How can I check the performance of my computer speed in...
  3. B

    Can You Help Me Fix this Matlab Error in My Code?

    Homework Statement Hello, i have a MATLAB code that simply lists a bunch of parameters with values and an equation that relates all of them together. I am getting on error that says Error in ==> randelltest at 17 Ys0=Yl*{(Pm-Pc)*Yc/Yl*(1-Av*Tm/2*Yc/Yl)-Av*Tm*Pm/2}*(1-1/B); Is there a problem...
  4. H

    MATLAB Matlab and preparing matrix lines

    In the Matlab program below U=[210; 100; 150] ky= linspace(-.2,.2); qx=sqrt(((150-U)/.2)^2-ky.^2) I want to have qx as a matrix in which each row is corresponding to one value of U: the first row corresponds to 210, the second to 100 and ... How should I do this? (I want to avoid the "for...
  5. Feodalherren

    MATLAB, separate odds and evens from matrix

    Homework Statement Given variable b that contains a row vector of length 10, assign the contents of the odd indeces in b to variable odd , and assign the contents of the even indeces of b to variable even. Examples: Input b = [8 -3 0 7 -6 -3 1 8 7 -2] Output odd = [8 0 -6 1 7] even =[-3 7 -3...
  6. M

    MATLAB Matlab finite difference schemes

    I have big problem with finite difference schemes (DS) on Matlab. I need write DS on Matlab, example: u_x=(u_(i+1,j)-u_(i-1,j))/2, we choose step is 1. On Matlab: u_x=(u( :,[2:n,n])-u( :,[1,1:n-1]))/2 And I can write u_y, u_xx, u_yy, u_xy. But now, I need to write for higher order, example...
  7. B

    Signal processing in matlab, what is signal length ?

    Homework Statement Use Matlab to construct a signal of length 2^13 = 8192 that contains only three frequencies: x=0.5*sin(2*pi*200*t)+0.2*sin(2*pi*455*t)-0.3*sin(2*pi*672*t) Compute and plot the absolute value of the DFT. What does the question mean by signal length and why is it expressed...
  8. S

    MATLAB Script for Bisection Method

    Homework Statement Not really for homework, but it is a script I am working on. It involves utilizing the Bisection Method for solving equations in one variable. However, I cannot seem to get it to work properly. It seems to enter the while loop and become stuck their. When I execute it by...
  9. S

    Can a Lock-in Amplifier Handle -30dB SNR?

    Hi, I wrote a simulation of lock in amplifier using Matlab and now i want to test it for different SNR. I added to the signal white gaussian noise. In all the spec that i read, always written that the lock in amplifier can handle -100dB of noise. When I add a noise of SNR=-30dB the lock in...
  10. T

    MATLAB Help: MATLAB time step function

    Hi guys I'm new to MATLAB but now i need to use it for my study. I've tried to learn by myself to run it but unfortunately it failed, so I need some guidance on how to run following time step function in MATLAB St = St-1 + Pt - ETt, St-1 + Pt - ETt ≤ Smax = Smax, St-1 + Pt - ETt > Smax then...
  11. J

    MATLAB Help please in matlab -- plotting a D'Alembert wave equation

    Can someone please help me in plotting a D'Alembert wave equation solution in MATLAB? I am so confused as how to plot it in MATLAB I need to plot a graph like the one below
  12. V

    MATLAB Matlab- storing iterations into a single matrix and file

    Hi guys: I have a program which is supposed to fit x- and y-data to a certain function and give me the optimum parameters. This is no problem. What I want to do though is to perform a for loop that allows me to plot the CHANGE in those parameters over time (as I conduct a real life...
  13. H

    MATLAB Matlab Programming Guide: Physics Student Resource

    I am looking for a concise textbook or anything else for Matlab programming, very useful and not necessarily introductory, appropriate to the needs of physics students especially solid state physics. Thanks in advance for any help that anyone can provide.
  14. J

    Need help on designing a conceptual HALE UAV

    Hi everyone, I am a High School student (final year) and am doing an extra-curricular project. Having complete autonomy on what we do the project on, I choose to design a High-Altitude Long-Endurance (HALE) UAV, such as the QinetiQ Zephyr [http://www.airforce-technology.com/projects/zephyr/] or...
  15. X

    FDTD of (ultrasound) wave propagation through muscle

    Im a mechanical engineering student currently, with a third year project of simulating ultrasound propagation through the abdomen. Currently i just want to simulate it going through muscle with no obstacles. I don't really understand where to start, I have formed some equations based on the wave...
  16. M

    Matlab Issue with aligning text in table format in .txt file

    Homework Statement uData is a 30x5 matrix with numbers. name_Database is a 30x1 cell array with strings of Names (e.g. Fake Subject 1, Fake Subject 2, Bob). What would fix the code so that the data aligns? (please see image for the misalignment). Homework EquationsThe Attempt at a Solution...
  17. M

    Matlab - Index exceeds matrix dimensions when writing .txt

    Homework Statement Index exceeds matrix dimensions Homework EquationsThe Attempt at a Solution I am trying to output into a text file something like this: Name ID scE ccE scC ccC Fake Subject 1 1 3 4 5 2 Fake...
  18. ellipsis

    MATLAB [MATLAB] Modeling gravity using polar coordinates Argh

    I've been using MATLAB (ode45) to simulate the mechanics of a rocket under the forces of gravity, drag, and internal thrust.y I've recently refactored my simulation to include 2d space, orientation of the rocket, etc. (So I can try to make it orbit, finding optimal ascent profiles, etc)...
  19. N

    Find Roots of Function & Return Column Vector

    i need to create a function that returns the pure zeros on the left semiplane and 0 if there is one and only one zero in the origin of the referential. the return has to be in a column vector like [root1;root2;...;rootn;0] or [root1;root2;...;rootn] if there is no root in the origin of the...
  20. A

    MATLAB [MATLAB] I am getting this error, could anyone solve it please?

    [MATLAB] The cod is: function RunLogOscilNumeric3 k =10; p0 =0.001; t = [0:0.01:10000 ]; omega = 1; N0 = 1; options =[ 'AbsTol',1e-3,'RelTol',1e-6] % options =odeset(...
  21. I

    MATLAB Line following Matlab Code. How to Start?

    So we're using NXT 2.0 and MATLAB to program a robot to follow a white line through a maze. I'm using a light sensor, color sensor and an ultrasonic sensor in the process. Any programming/Coding ideas of how i should start? This is the maze...
  22. A

    MATLAB Could you check (if statment block) in my MATLAB code please?

    function RunlogisticOscilnumericalfisherfixedn0omega omega=1; N0=1; k = 10; A = 1; p0 = 0.1; tspan=(0:0.1:4); [t,p] = ode45(@logisticOscilnumerical,tspan,p0,[],omega,k,N0); figure(1) plot(t,p) xlabel('Time') ylabel('p') P = @(T) interp1(t,p,T); f = @(t) ( ( A.*( ( N0.*...
  23. A

    MATLAB MATLAB code for Computational Fluid Mechanics

    Hello guys, I'm writing to get some help on an exercise I've been thinking but I can't get to solve. I have to write the code for the Example 8.5 of the book White, Fluid Mechanics. Here is the problem and the solution I have to obtain. It is about one duct that has three sections in which I...
  24. beyondlight

    MATLAB MATLAB: Handle Large GPS Data Sets Easily

    I have to analyze a large set of GPS measurement data in MATLAB but when i transfer the list of data in the editor like: 8374847.323 8374827.545 8374863.565 8374831.775 8374889.923 8374872.112 ... How do I put it in a array A= [value1 value2 value3 ...valueN]?
  25. A

    Linear Equation System Solution and Matrix Multiplication in MATLAB

    Homework Statement Solve (symbolically) the system of linear equations 3x + 4y + 5z = 2 2x - 3y + 7z = -1 x - 6y + z = 3 Check your answer using matrix multiplication.[/B] Homework Equations N/A The Attempt at a Solution This assignment was given with about 20 different basic MATLAB...
  26. _N3WTON_

    Matlab: arrays, matrices, and rotating plots

    Homework Statement Generate a triangle. For this problem, generate a triangle at a grid of points that are finely spaced in the x dimension. The triangle is defined as follows: -Side 1: y = 0 for x = 0 to 2 -Side 2: x = 0 for y = 0 to 1 -Hypotenuse: y = 1-0.5x for x = 0 to 2 Alternatively, the...
  27. P

    Most Effective 7 Members Truss in Scilab

    Hello everyone, I'm attempting to come up with a way to calculate the most efficient 7 members truss layout using Scilab. The assignment is to make a highway sign support. It has to be L shaped and the truss system is only for the top horizontal part. Two supports. The sign is hanging at the...
  28. A

    MATLAB [Matlab] Which is the good solution My vs. School - curve fitting?

    Hy, I wonder which is the good solution for this problem: Nonlinear least square problem: function: y = x / (a + b.x) linearization: 1/y = a/x + b substitution: v = 1/y , u = 1/x >> model v = b + a.u What we did in school: x = [1 2 4 7]; y = [2 1 0.4 0.1]; v=1./y; u=1./x; n = length(x)...
  29. W

    MATLAB Generally, How the ship motion is calculated base on MATLAB?

    Generally, How the ship motion is calculated base on MATLAB?
  30. A

    How to do Linearization for Non-linear least squares?

    Hy I want to know how to make linearization for some function,...what should by in Non-linear least squares problems. In my book I have only this example how to do: http://i.imgur.com/MUFiHkr.pngSomeone could me help how to do, some receipt of method what I need to do? Non-linear least...
  31. frejatroop

    How to display variables on MATLAB plots

    The question gives the code for MATLAB to solve Hill equation with 5 different values of distance x, which will generate 5 plots on same axis. But the plots will be Force versus time. The question ask you to interpret the relationship between X and F(t). How do I know this plot represents...
  32. N

    Help with DTMF and MATLAB FFT - Digit Recognition

    i am trying to figure out digits in a dtmf signal using MATLAB with the fft command however i not sure how to figure out what digit is being pressed. I am doing this stem(abs(signal)) and get a plot with several digits pressed but not sure how to figure out which are pressed, any help would be...
  33. S

    How Can You Calculate the Area of a Polygon in MATLAB?

    Homework Statement H[/B]ow to create a function to determine the area of a polynomial that has N vertexes in MATLAB? Homework Equations p = input('Introduce the number of vertexes of the polynomial:') n=p-2; The polynomial can be devided by N-2 triangles and the area of each triangle is given...
  34. M

    MATLAB [Matlab] How to use inputdlg string variable in text file?

    I am trying to display the input that I enter into the dialog box from "inputdlg" function into a text file. This is what I've so far: prompt={['What is your name?']}; title = 'Name Machine'; answer = inputdlg(prompt, title); name = answer{1}; fileID = fopen('NameMachineFive.txt', 'w')...
  35. W

    MATLAB Quiverplot of r hat / r squared in matlab

    Hi, I want to quiverplot this function in matlab. >> [X Y] = meshgrid(-2:.2:2,-2:.2:2); >> X1 = X./(X.^2+Y.^2).^1.5; >> Y1 = Y./(X.^2+Y./2).^1.5; >> quiver(X,Y,X1,Y1) >> I got this: What am I doing wrong?
  36. D

    MATLAB Matlab R2013a and OSX 10.10 Yosemite

    Looks like OSX Yosemite broke Matlab. I don't want to spend 100$ to upgrade to this year's version just to make it work. Suggestions?
  37. J

    MATLAB MATLAB: Program Unknown # of 'for' Loops w/ i1,i2,iN Variables Smartly

    Hi :) I need to program several nested 'for' loops which differs only in index of their variables inside. So I need to convert this: for i1 = 1000:-d:0 for i2 = (1000-(d*i1):-d:0 ... for in = (1000-(d*in-1):-d:0 some function containing all index variables like: b=(i1*A( :,2), i2*A( :,3), ...
  38. _N3WTON_

    Matlab Programming: Simple Guessing Game

    Homework Statement Write a program for a simple guessing game. The program should first prompt the user for a number between 1 and 100. After each guess the program should inform the user whether the guess was too high or too low. When the user picks the correct number, inform them and let them...
  39. T

    MATLAB Mutual inductance of two disk coils (MATLAB)

    Hi, I'm been spending way too much time this weekend, wrestling with the equations provided in the paper [The mutual inductance of two thin coaxial disk coils in air, Babic S., DOI: 10.1109/TMAG.2004.824810], but I just can't seem to verify the results obtained in the examples in the journal...
  40. Y

    New to MatLab: Having some trouble

    Homework Statement This isn't really for homework, but I wasn't sure where else to put it. anyone wishes to move it, that is fine. I'm just getting into some research and I was tasked with reading data from a text file into MatLab and then graphing it by fitting it with exponentials. I am very...
  41. mesa

    Trouble with understanding MatLab code

    Homework Statement A = [1 3; 2 4]; %Okay, so we are starting with this matrix N = 2; %Here we are setting N equal to '2' for k = 1:N %So here we have a 'for loop' for variable 'k' starting at 1 in increments of '1' up to 'N', which %happens to be '2' so once this function gets to '2' it...
  42. H

    How to Construct a Matrix for Diffusion PDE in MATLAB?

    I am going to do a numerical simulation of diffusion in matlab. The diffusion coefficient is concentration dependant, and i use an array operation to calculate D(x), so it is known. Based on Fick's second equation: $$ \frac{\partial C}{\partial t} = \frac{\partial}{\partial x} D \frac{\partial...
  43. M

    MATLAB Why Does Matlab Say Matrix Must Be Square When Using mpower?

    When running the following code on Matlab: >> y(i) = y(i-1) + (0.5 * y.^3 * exp(t^2 + t))*h I get the error: ? Error using ==> mpower Matrix must be square. It seems fairly simple but I'm not quite sure what I'm overlooking. Any help with regards to what I may be doing wrong would be...
  44. M

    LaTeX Concept and subject of latex and its usage and related questions on latex

    Hi, I have newly encountered with a subject called LaTeX. I try to learn it. I know it is a document preparation program. Can I install on my PC and start to use it like Matlab? For example where can I use this code? http://en.wikipedia.org/wiki/AMS-LaTeX Thank you.
  45. R

    MATLAB Solving Steady State Heat Conduction Eqn w/ MATLAB

    HI guys,this is my first programming experience , i have developed an MATLAB code for steady state heat conduction equation , on governing equation dt2 /dx2 + dt2/dy2 = -Q(x,y) i have solved this equation with finite difference method, As far as i know if we increase the mesh size it leads...
  46. M

    How to Compute Tri-Coherence from Time-Series Data?

    Dear all, I have time-series data, from which I would like to compute the tricoherence. After some googling, it seems that I will have to write my own code. But before I begin, let me ask this. Do anyone here know of a code, library (fortran, c), module (python, matlab, IDL, mathematica)...
  47. M

    Maple Math Plotting Software for Electrical Engineering

    Hi All: I am an electrical engineering undergrad. I would like to learn a math plotting software which would be helpful in visualizing topics in advanced calculus (my immediate need). It would also be helpful if the math plotting software was of some use in electrical engineering, but this is...
  48. W

    Undefined function 'table' for input arguments of type 'double'.

    Hi! Using Matlab R2012a: typing this example to create a table: t = [0 .3 .8 1.1 1.6 2.3]'; y = [.82 .72 .63 .60 .55 .50]'; B = table(t,y) Getting this error:Undefined function 'table' for input arguments of type 'double'. Don't know what to do.. Edit: another example: >> Age =...
  49. $

    Silvaco Atlas export Energy Band Diagram programatically

    Hi, I perform my post-processing and analysis of data from silvaco in MATLAB and would like to export values from the .str file to a file that can be read easily into matlab. Does anyone know of a way to do this programmatically? I can do it in tonyplot, but I've got everything else scripted...
  50. gfd43tg

    Adding code in box on the forum

    Hello, I am taking MATLAB this summer and will be having a number of questions on this forum about all my bugged code when I make it. Before I begin, I was wondering how do people add those ''code boxes'' when they make a thread that shows all their code within the post. Thanks Example: Post...
Back
Top