Matlab Definition and 1000 Threads

  1. E

    MATLAB Does MatLab have this kind of function?

    I have a set of variables that are always inputs for several functions that I made. Does MatLab have a kind of function that stores these variables into a single matrix (or similar) so that I just need to call this matrix for each function rather than calling them one-by-one as inputs into the...
  2. E

    MATLAB How to Set a Variable in Matlab as an Integer Only?

    Is there a function in Matlab that presets the value of a variable as an integer only? For example I will set the variable 'y' as an integer at the very beginning of the code, and whenever the variable gains a new value it automatically returns an integer value. Thank you in advance.
  3. J

    MATLAB Matlab to r-pi to I2C device issue

    I have a 3-Axis Digital Compass IC HMC5883L I2C chip, I just want to use it to learn how to talk to sensors via a Matlab to raspberry-pie to I2C chip link. The set up from Matlab to the pi is straight forward and simple, the issue I'm having seems to be the address I'm being returned when...
  4. Sirsh

    MATLAB Efficient MATLAB Repeating Function for User-Defined Rotations

    Hey all, I need your help writing the meat of a function that I need for a MATLAB script I'm writing. The jist of it is, starting from 0°, when between 0.0° - 5.0° apply a certain value, when between 5.0° - 15.0° apply another value. However, the relative amount of rotation can be user...
  5. JasonHathaway

    Generating Ricean Channel using MATLAB

    Homework Statement I want to generate a Ricean channel using MATLAB Homework Equations Assuming that Ω = -30 dB. The Attempt at a Solution I know how to generate a Rayleigh channel using matlab: H = 1/sqrt(2) * ( randn(N,M) + j*randn(N,M) ) But I really have no idea how to do that for...
  6. F

    MATLAB Question about Fourier transformation in Matlab

    Hello everybody. I am triying to calculate a band-pass filter using the Fourier transform. I have a vector with 660 compomponents; one for each month. I am looking for a phenomenon which has a periodicity between 3 and 7 years (it's el niño, on the souhtern pacific ocean). I want to make zero...
  7. P

    Matlab code problem with differential equations

    Homework Statement For a following differential equation d^2y/dx^2-4y=(e^x)/x  Find the solution using numerical methods Homework Equations d^2y/dx^2-4y=(e^x)/x The Attempt at a Solution %num dx=0.01; x=1:dx:3; l=zeros(1,length(x)); m=zeros(1,length(x)); l(1)=1; m(1)=0.25; for...
  8. R

    Model reaction diffusion brusselator 2d matlab

    Hello, I have a project (model reaction diffusion brusselator 2d) ∂u/∂t=A+u^2v-(B−1)u+D1((∂^2)u/∂(x^2)+(∂^2)u/∂(y^2)) ∂v/∂t=Bu−u^2v+D2((∂^2)v/∂(x^2)+(∂^2)v/∂(y^2)) initial conditions: u(x,y,0) = 0.5 + y, v(x,y,0) = 1 + 5x. boundary conditions: ∂u/∂n = 0, ∂v/∂t = 0 n-external normal to the...
  9. kelvin490

    MATLAB How to make 2D plot of points with different colors?

    I want to make a 2D plot of points with different x, y coordinates and have colors depending on a separate variable. I have make column vectors for x and y coordinates and another column containing 1 or -1. I would like to represent the points with 1 as red and -1 as blue points. I have codes as...
  10. N

    MATLAB Creating Music with MATLAB: Code, Synthesis, and Possibilities Explained

    I have project code using MatLab and so far I am having difficulties of understanding what it is asking for. May anyone explain for me please. The file fugue.mat It contains numerical data that encode about 30-seconds worth of Johann Sebastian Bach's Fugue #2 for the Well-Tempered Clavier. You...
  11. S

    How Do You Implement Root-Finding for Compressibility Factors in MATLAB?

    Homework Statement Compute and plot the compressibility factor (y) verses pressure (x) for the (1) Van der Waal’s (2) Redlich-Kwong and (3) Peng-Robinson equations of state. Compressibility Factor, Z = (P*v)/(R*T); where v is the specific volume (V/v). Data for n-Butane: T = 500 K; Tc = 425.2...
  12. Captain1024

    Find Fourier transform and plot spectrum by hand & MATLAB

    Homework Statement Link: http://i.imgur.com/JSm3Tqt.png Homework Equations ##\omega=2\pi t## Fourier: ## Y(f)=\int ^{\infty}_{-\infty}y(t)\mathrm{exp}(-j\omega t)dt## Linearity Property: ##ay_1(t)+by_2(t)=aY_1(f)+bY_2(f)##, where a and b are constants Scaling Property...
  13. M

    MATLAB MATLAB - Motion of a body around a central one

    Hello everyone, I've written a code using ode45 which describes the motion of a body m around a central one M (e.g a satellite around earth). I've done it with initial values that set the trajectory of the particle to be elliptic. Clearly, energy and angular momentum need be conserved in this...
  14. MiloBoots

    MATLAB How to extract pdb data in Matlab

    Hey I want to be able to extract the coordinates of different elements in a PDB data file. I have been able to extract the coordinates for all the atoms in 3 arrays in the x, y, z directions. However, I would like to have the x, y, z coordinates for each element separate. So an array for the...
  15. S

    MATLAB Python to Matlab Conversion for fscanf & DWT

    Hello, 1. Homework Statement I find diffuculties to transform fscanf and to apply the discrete wavelet transform order 2 from matla to python. Homework Equations This is the MATLAB code: D_P=fopen('distance_profil.txt','r'); i=0; while(feof(D_P)==0)% test for end of file i=i+1...
  16. W

    MATLAB How Can I Parse MCNP Output Files in MATLAB?

    Hello! I am really glad to find this forum! I was wondering if anyone has a MATLAB code to parse the MCNP output file MCTAL? I did some Lattice simulation but it seemed hard to read the MCTAL file directly.. Best regards
  17. M

    MATLAB MATLAB extract numbers in .txt file

    Hi PF! I have a .txt file with spaces and letters, along with numbers. It looks something like this: 12.0 42.0 21.0 32.0 ICF-8-1 23.0 24.0 46.0 600.0 Additionally, the first two sets of numbers each represent a coordinate pair. Then the first coordinate is (12,42) and the second is...
  18. Euler2718

    MATLAB "Linear Model" of a Pendulum via Euler's Method

    In my problem the linear modal is defined as the first term in the series expansion of \sin(x) so: \sin(x) = x - \frac{x^{3}}{3!}+\dots \sin(x) = x is the linear modal. So with this, I then have to write \frac{d^{2}x}{dt^{2}} = -\sin(x) as a system of x^{\prime} and y^{\prime}, so...
  19. Euler2718

    Rewriting ODE's into lower orders

    Homework Statement Express \frac{d^{2}x}{dt^{2}} + \sin(x) = 0 In a system in terms of x' and y'. Homework EquationsThe Attempt at a Solution [/B] I seen this example: x^{\prime\prime\prime} = x^{\prime}(t)\cdot x(t) - 2t(x^{\prime\prime}(t))^{2} Where they then wrote: x^{\prime} =...
  20. F

    Implement the formula -x(i-1) + 2x(i) -x(I+1) in Matlab

    Homework Statement I want to reproduce the following matrix: A= [1 -1 0 0 -1 2 -1 0 0 -1 2 -1 0 0 -1 1 ] What i want is to reproduce the second and third row with the formula -x(i+1) + 2x(i) -x(i-1) = 0 This is a coupled oscillation system of N masses (hanging in a rope). The first row...
  21. L

    Plotting in Matlab: w vs z in (-1,1) Domain

    Homework Statement (In Matlab) The variables w and z are related by w=cos(n*acos(z)) and z=cos(acos(w)/n) for n = 1,2,3,4 plot w vs z over domain (-1,1). Homework Equations w=cos(n*acos(z)) z=cos(acos(w)/n) The Attempt at a Solution First I tried to substitute z into w and thought since I...
  22. N

    MATLAB MATLAB Project: Tips, Guide & Concepts

    I have a project and i need some help to understand the concepts, what is it asking for, major tips, and guide me through the process of the project. The program I will be using to program will be...
  23. N

    What are the areas of expertise for NumberSix?

    NumberSix solves problems using mathematics and mathematical software. He has worked on gesture recognition, speech recognition, video compression and several other highly mathematical areas. He has expertise in mathematical modeling, statistics, and linear algebra. He has many years of...
  24. Chandlerw88

    MATLAB MATLAB For Loop Help: Plot SVAJ Accel Graph w/ Norton 5th Ed

    I have created a code in MATLAB that can plot the acceleration graph of the SVAJ diagram for 3 of the SCCA Family of Functions with a theta range from 0 to Beta. I cannot for the life of me, figure out what I am doing wrong, maybe some fresh eyes can help me. Ignore the 'trial', I'm trying to...
  25. PhysicoRaj

    Design a controller using Matlab

    Homework Statement For the plant: ##G(s)=\frac{1}{s(s+2)(0.4s+1)}## Design a controller in Matlab such that ##K_v=4## , phase margin = ##60^o## and zero steady state error for step input. Homework Equations ##e_{ss} = Lim_{s->0} \frac{s R(s)}{1+D(s)G(s)}## Lead/Lag...
  26. T

    MATLAB Arduino-MATLAB communication using SerialEvent() for PID Loop

    Hello, I have an arduino code for driving a peltier pile to a given set point (TEMP_SP). I am trying to input the set temperature from Matlab GUI (with different protocols, user will enter n temperatures and the time intervals, arduino will implement the PID controller and output the...
  27. kelvin490

    MATLAB How to extract data from existing JPEG/TiFF graph?

    Is there any method to extract data from a graph in JPEG/TIFF format, using simple software such as MATLAB? I have a graph as shown below: I only have this picture but no raw data and I want to plot the black curve in this graph. How to get approximate numerical data of the x and y axis...
  28. jiaying

    MATLAB Matlab -- how can i use a FOR loop if I have 2 variables changing

    Hey,for following code the 3rd loops i need to have 2 variables m and q .Could anyone help? for t=1:maxiterations toterror=0; for j=1:numfeature totslope=0; for i=1:m&&q=1:numfeature z=0; for jj=1:numfeature...
  29. Erkan Tur

    Solving MATLAB Problem: Sines, Cosines & Tangent Arrays

    Hello everyone, I've stuck on a problem, and I need help Problem: 1: a) Evaluate and store the sine and cosine values of the values from 0 to 260 10 by 10 and store them to the separated arrays called sines and cosines before plotting the sinusoidal graphs of these arrays, b) Evaluate the...
  30. M

    MATLAB How to Define Temperature in a MATLAB Mass Transfer Simulation?

    Hi Guys, I'm trying to do a simple first-order, 1d (x-direction) simulation of mass transfer with the finite element toolbox in MATLAB for the following closed set of equations: (Please note: "X" is not to be confused with the lowercase spatial dimension "x") However, every time I...
  31. Euler2718

    MATLAB Problem with Generating Barnsley Fern Fractal in MATLAB

    The code is as followed: function fern() AI = [0 0 ; 0 0.16]; AII = [ 0.85 0.04 ; -0.04 -0.85 ] ; AIII = [ 0.2 -0.26 ; 0.23 0.22 ] ; AIV = [-0.15 0.28 ; 0.26 0.24 ];BI = [ 0 ; 0]; BII = [ 0 ; 1.6]; BIII = [ 0 ; 1.6]; BIV = [0 ; 0.44]; N = 10000; I = 50; H = zeros(N,2); for n=1...
  32. G

    Compliance matrix from strain matrix, Matlab

    Homework Statement (I'm trying to replicate some results in an academic paper where they have calculated elastic properties of a crystal. Because I'm going to do a lot of similar time-consuming calculations following this one, I need to learn how to do them using a computer.) The compliance...
  33. perplexabot

    MATLAB Solve Riccati (DARE) with MATLAB

    Hey all, I was wondering if you can help me define the arguments for the dare() function of matlab. Here is the DARE form I have: \begin{equation} \begin{split} \Phi(p_\infty) &= \Phi_\infty = \Phi_{33}-\Phi_{32}(\Phi_\infty+\Phi_{R})^{-1}\Phi_{23}\\...
  34. KonaGorrila

    MATLAB How to get the last variable of a for loop in MATLAB

    Aloha guys, I am just having trouble getting MatLab to output only the last variable of my "for loop." If anyone can help all I am looking for is an example of notation. p.s. I have done this before just not in a while and will continue to look through my old scripts and functions. just not in...
  35. I

    I How to turn model of Schrödinger's Equation 2D?

    Hi, I am a student in the Netherlands, currently 17 years old and at the end of my 'middelbare school', meaning that next year I'll be a bachelor student at a university. I am doing an extended essay/research thing that is custom you do in your last year, with a friend of mine. We picked the...
  36. E

    MATLAB What is wrong with this WHILE loop?

    Here is my code: while a ~= 3 || b <= 1; a = a - 1; (other expressions); end; For this code, the 'while' loop should stop when 'a' reaches 3, however it does not, even though 'a' starts with a higher value than 3. The 'other expressions' part are calculations that manipulate 'b', the only...
  37. B

    Problems with Matlab code for simulating spring motion

    The issue I am having is setting up the actual program for the problem. I am having trouble interpreting the code and, because of that, having issues getting it to work properly. The whole thing was written with Matlab and the goal was to write a function that could simulate the motion of a...
  38. J

    MATLAB Solving Orbital Motion Equations with RK4 Using MATLAB

    I'm trying to plot the solutions of the second order differential equation d^2R/dt^2 = GM/R^2 + Lz^2/R^3. I'm reducing this to a system of first order ODEs and then using RK4 to solve this system. My code is given by function RK4system() Tsim = 10...
  39. M

    MATLAB Discovering MATLAB: Tips for Learning from Scratch

    Hello everyone, For those of you who are familiar with MATLAB and have worked with it in the past, I would like to hear from you guys about efficient and good ways to learn it from scratch. I would appreciate it if you can also specify websites, books, online courses or whatever it is that you...
  40. X

    Designing butterworth filter of Nth order

    I want to design a digital butterworth lowpass filter of nth order, with only freedom of choice to user being order of the filter and the cut off frequency, i already have a 1st order low pass. Code: T = 1/(2*pi*this.fc); this.A = -1/T; this.B = 1/T; this.C =...
  41. J

    Matrix riccati differential equation using matlab

    Homework Statement Homework EquationsThe Attempt at a Solution
  42. pairofstrings

    MATLAB IDE with support for MATLAB and Circuit Simulators

    Hello. I am using Linux platform to do Embedded System Programming. I want to know the name of Integrated Development Environment software that runs on Linux or Windows (via Wine on Linux) and that has support for MATLAB and any circuit simulation software. Also, please let me know a good...
  43. Guidestone

    MATLAB Matlab deployment Error because of folder permissions

    Hey guys, so I wanted to give Matlab a shot regarding programming standalone applications but I keep getting the same error whenever I use "deploytool" in the command prompt. The error message picture is attached to this message. According to the error message I must change my MATLAB current...
  44. A

    MATLAB Calculating Total Eigenvalues in Matlab

    Hi. How do you calculate Total eigenvalues smaller than a certain value in Matlab?
  45. A

    MATLAB How to Calculate the Second Derivative of a Curve in Matlab?

    I have a set of data as follows, How can I calculate the second derivative of the curve obtained from these data. x=[0.1;0.07;0.05;0.03;0]; r=[-98.9407;-105.7183;-111.2423;-116.0320;-120.0462];
  46. I

    MATLAB Transforming part of matlab code to Fortran90

    Here are my Fortran codes: program test implicitnone integer*4 nxProjPad, cf, numViews, cc, index, indRad, iv, i, INDEX1, d, n real*4 v4, v5, RSS, S1, F1, gMDL real*4, dimension(:), allocatable :: array, sum, cumsum, transpose, log, SS1, SSs nxProjPad=185 numViews=180...
  47. Woa90210

    What was most helpful understanding Signals and Systems?

    Hey guys! This is my first day on the forum so, hey! I'm a third year electrical engineering student and I'm really having some trouble with Signals and Systems so I want to know what helped other people understand it so that maybe I could try some of their methods. What were your biggest...
  48. kelvin490

    MATLAB How can I append new columns to an existing Excel file with MATLAB?

    I would like to ask how to use MATLAB to append new columns into existing excel file without altering the original data in the file? In my case I don't know the original number of columns and rows in the file and it is inefficient to open the files one by one and check in practice. Another...
  49. MAKK

    MATLAB How to Convert Matlab Gaussian Cone Code to C++?

    anyone help me to convert this sample code of Gaussian Cone shape of random number code in Matlab into C++ function GaussianCone clear all; clc; mx=10000; my=mx; mz=mx; z=[1:1:mz]'; sigma=0.01; R=0.5; mu=0; sigmax=sigma+R*z; sigmay=sigma+R*z; x=zeros(mx,1)...
  50. R

    MATLAB Interpolating a zoomed in colorscale image in Matlab

    I have no idea what I am doing wrong. I have already found multiple places on the internet which give clear examples of how to do this, yet I am still struggling. Please help me out, or at least point me somewhere. My code is below. I am trying to interpolate pixels of a full color image. The...
Back
Top