Matlab Definition and 1000 Threads

  1. R

    MATLAB Finite Element Analysis (FEA) in MATLAB - Textbook Guide

    Does anyone know of a great text that shows how to set up FEA in MATLAB in detail. I have wrote out the sort of pre pseudo code from John Andersons - Computational Fluid Dynamics now I just need to build it out in code. I am old school with the hand sketches, hopefully this does not get me a...
  2. M

    MATLAB Switched from win10 and MATLAB to ubuntu and python"q"

    Hi, I felt like I have to learn more than one coding language, and wanted to strengthen my coding skills in general. I am good with Relap5 but I want to learn OpenFoam. is what I did logical and going to be worth the pain ? also I only have the Relap5 version of a windows ,is it possible to run...
  3. S

    Dealing with 1000 digit numbers

    Hi, Mostly i work with Octave / Matlab but i am trying to get into python also. Lately i have a couple problems where my numbers can't be represented in binary64 or float64 default format because they exceed the max of 1.8x10^308. Is there a common way people deal with this (without toolkits)...
  4. R

    MATLAB Finite element skeleton code for matlab

    Hello, Does anyone know if a finite element skeleton source code exists. Finite element can be used for structural memebers, gas dynamics, etc. But the over all stepping software is the same and then just input the core equations. My application is for pseudo one dimensional compressible...
  5. S

    Simulink bloc of PMSM (permanent magnet synchronous motor) parameters

    greetings. I designed a system on simulink. it is missing a pmsm. I found a block on simpowersystems in simulink nde matlab. I hope that this engine provides a nominal power of 96kw and maximum of 100kw. so how to test it? to verify that this engine can deliver these two powers? cordially. said.
  6. A

    Converting impedence response to electrical conductivity

    Hi, I have a curve, impedance magnitude vs frequency. i would like to convert this curve to electrical conductivity vs time. how can i do that?
  7. jamalkoiyess

    MATLAB Hardware advice for a MATLAB oriented PC build

    Hello PF, I am considering some options in my upcoming PC build and want to choose the one that performed best in MATLAB. What I mostly do is velocimetry with a big amount of points, image processing, statistical analysis. My options are between 2 CPUs: AMD Ryzen 2700 - for the 8 physical...
  8. E

    MATLAB Evaluating Nested Integral in MATLAB for General K

    Hello, How can I evaluate the following nested integral in MATLAB for a general value of ##K## {\int\limits_{u_1=0}^{\gamma}\int\limits_{u_2=0}^{\gamma-U_1}\cdots \int\limits_{u_{K}=0}^{\gamma-\sum_{k=1}^{K-1}U_k}}f_{U_1}(u_1)f_{U_2}(u_2)\cdots f_{U_{K}}(u_{K})\,du_1du_2\cdots du_{K} where...
  9. F

    MATLAB Translating from Mathematica to Matlab

    Hello everyone. I was wondering if someone could tell me how to write the next line of Mathematica code in Matlab. x = Sum [ Sqrt [ vals[ [ j ] ] ] * vecs [ [ j, All ] ] * z [ [ j ] ] , {j,1,10} vals is a eigenvalues vector, vecs is a eigenvector matrix and z is a vector of random variables...
  10. T

    MATLAB Convert R Code to MATLAB for Detrended Cross Correlation Analysis

    Homework Statement I would like to convert this R code into matlab. This code perform a calculation of beta coefficient based on Detrended cross correlation analysis. Homework Equations require(tseries) require(fracdiff) require(matrixStats)DCCA_beta_avg<-function(y,x,smin,smax,step){...
  11. dRic2

    MATLAB What Does the Final Equation Represent in a Chemical Distillation Column?

    Here's what I have to do: 1) I arbitrary give a first value to the variable ##x_b##. Let's say ##x^{(0)}_b = 0.3## 2) I find ##x_D## by evaluating this integral: $$ln(\frac {52.32} {100}) = \int_{0.5}^{x^{(0)}_b} \frac {dx} {x^{(0)}_D - x}$$ 3) I use the value I got for ## x^{(0)}_D## to...
  12. T

    Natural frequency in stationary and rotating frames....

    Hi, I am trying to gain insight into using stationary vs. rotating coordinate frames for natural frequency calculations. I have seen many FE codes suggest that critical frequencies can be calculated differently in rotating and inertial frames, so i wanted to do a 1D calc to see for myself how...
  13. T

    Solving a set of nonlinear quadratic equations

    I would like to solve this system, which is a sets of non linear quadratic equations, the system needed to be solved can be expressed in general as follow: ϒϒ'C – ϒα = B Where ϒ=(ϒ1,ϒ2,...ϒn)’ is a column vector and ϒ’ its transpose C=(c1,c2,…,cn)’ and B=(b1,b2,…bn)’ are a columns vector And...
  14. D

    Problem with plotting a function in MATLAB

    Homework Statement Write code for solving the integral ##\int_{0}^{x}e^{-t^2}dx## using simpsons method and then plot the function from ##x = 0## to ##x = 5## with ##0.1## increment. Homework Equations 3. The Attempt at a Solution [/B] I was told that the best way to plot the function is to...
  15. C

    MATLAB Karhunen Loeve Expansion in Matlab

    Hello everyone. I am trying to generate the KL expansion of a stochastic process. I use a Monte Carlo sampling method to generate the process, which involves two random variables and I compare it with it's theoretical mean for 50 values of time and they look quite similar. Then, I calculate the...
  16. lc99

    MATLAB MATLAB: forces acting on an object

    i have a assignment for my MATLAB (first year) class, and I am slightly confused om what exactly i should be coding. im not struggling with the coding part, but what i am suppose to code. im used to coding based on what it is needed. So, for my project, I am suppose to represent the forces...
  17. C

    Calculating Projectile Distance with MATLAB: Physics Homework Help

    Homework Statement I have to write a MATLAB script that calculates the horizontal distance of a projectile fired from a cannon set at 45 degrees by a compressed spring. I know that the spring constant is 6 lb/in, the unstretched length of the spring is 1 foot, the mass of the projectile is 0.1...
  18. quasarLie

    MATLAB Creating a Histogram with Data from a File.dat in MATLAB

    Hello everyone, I'm trying to make a MATLAB program which read a file.dat and then do a histogram This what I did Data2=importdata('Ma.DAT'); R1=Data2.data(:,17) R1(R1>-9.9) L = 0:0.1:8; histc(R1,L) bar(L,histc(R1,L),'histc') xlabel('R1') ylabel('counts') [FONT=PT Sans...
  19. Eswin Paul T

    MATLAB Sovling Bernoulli's differential equation in matlab?

    I have a first order bernoullis differential equation. I need to solve this in matlab. Can anyone help me?
  20. quasarLie

    MATLAB How to Plot Data into Bins in MATLAB

    Hello, I am writing a program in MATLAB that reads a file.dat, I also want to draw by bin of z and degraded the color for example for z between 0 and 1 put the color red, for z between 1 and 2 put blue. But I do not know how to do it Here is my code Data2=importdata('fichier.dat')...
  21. M

    MATLAB Exporting Multiple Variables from Mathematica to MATLAB - Quick and Easy Guide

    Hi PF! I'm trying to export two matrices ##A## and ##B## from Mathematica into MATLAB. I can export one just fine; so far what I write is SetDirectory[NotebookDirectory[]] Export["data.mat", {A}] Do you know how I can export two variables at a time and then how I can export directly into...
  22. C

    MATLAB Coding angular spectrum of waves in a fluid

    Hi, I am trying to code ultrasonic transducer radiation in water using angular spectrum of plane waves. I am having difficulties in the sampling and fft. If anybody has an idea about this can you please help me out? I can paste the code once i get some response. Thanks for your help!
  23. Bloopy

    MATLAB: Verification of Superposition Principle

    Homework Statement Verify Superposition Principle using Matlab, given a DC source of 100V, an AC source of 50V, 60Hz and three resistances, R1=10 ohms, R2=20 ohms and R3=15 ohms. I created the circuit below and ran the program. Result: Homework Equations None, just running the program...
  24. Nikhil N

    MATLAB How can I run Python by getting values from Matlab

    I have a python script for which the input data are coming from Matlab. I have tried to use pymatlab, but it is failing. Can anyone suggest any other method?
  25. grandpa2390

    MatLab Code for Baseball Not Working

    Homework Statement I am trying to create this plot in MatLab I'm starting out doing the simplest one, no drag, no wind. simple kinematics, right? but I can not get my code to run. Homework Equations Kinematic Equations The Attempt at a Solution close all clear all clc %%defining variables...
  26. grandpa2390

    Why Won't My Matlab Code Work?

    Homework Statement I need to write a program in Matlab that accomplishes this graph: I keep getting an error on Line31 Column 161 about unexpected parenthesis. They look balanced to me. If I take one away from either side, I get an error that I am short a parenthesis. I also need to change...
  27. C

    MATLAB How can I create a matrix with two columns in Matlab using a modular operation?

    Hello everyone. I am trying to create a matrix in Matlab with two columns which should look like as follow: 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9... 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1... Has anyone programed something like this before?
  28. SemM

    MATLAB Making a short test for self-adjointness

    Hi, I made the following command in MATLAB to test for the following: \begin{equation} \langle T\psi,\phi\rangle=\langle \psi, T\phi\rangle \end{equation} %Self-adjoint test syms x a = (diff(exp(-x^2)))*exp(-2*x^2) b = (diff(exp(-2*x^2)))*exp(-x^2) W = int(a, x) P = int(b, x) O=W-P and it is...
  29. grandpa2390

    MATLAB What is each step of this Matlab program doing?

    So here is the program. I've spent a few hour trying to follow it. I numbered each line and after the code will try to explain what I think is going on in each line. I'm completely new to Matlab, and programming is a great weakness to me. I need help. 01. nuclei=zeros(1,100); 02. t=nuclei...
  30. R

    MATLAB Fraunhofer diffraction simulation in Matlab

    Hello, below is the screenshot from the book INTRODUCTION TO MODERN DIGITAL HOLOGRAPHY With MATLAB (TING-CHUNG POON, JUNG-PING LIU). This book is free to download. There is a script for Fraunhofer diffraction pattern and equation 1.40 is Fraunhofer diffraction formula in terms of Fourier...
  31. Nikhil N

    Dynamic modeling of a system and transients of the system

    Consider, I have a dynamic system model for air compressor. Which means I have modeled the system by including its physics. Does this means I also included the transients of the system? What I think is, when i modeled any system with equations, I think that includes the transients. Is it...
  32. grandpa2390

    How do I translate this program to matlab?

    Homework Statement Homework EquationsThe Attempt at a Solution I'm taking Computational Physics. And I am trying to learn how to program in matlab. But I don't understand the author's code and what it is in MATLAB code. Can someone help me?
  33. L

    MATLAB Plotting Coordinate Transformations in Matlab

    I was reading this article (https://www.nature.com/articles/srep40083) about designing a panoramic lens with transformation optics, and wanted to try to play around with modifying the coordinate transformations. I contacted one of the authors of the article, and she mentioned that she plotted...
  34. P

    MATLAB Help with MATLAB music code | Signals & Systems

    For my signals and system class were creating music. I am given a structure with three variables, frequency/notes, duration, and pulse. ex: frequency(in note numbers which i then convert to frequencies)[44 45 47 50...]. duration[2 1 1 3 4...] with pulse duration being .25s and pulse[1 3 4 5 8...
  35. Okinawa Rikenata

    How to get x-y coord. from x-z coord. and y-z coord.?

    I have data from tiltmeter. It has 3 components (time, x, and y) and stations. I use Matlab for calculating the data (.csv) until i get some plots. I have two plots, time-x and time-y. Each plot has a trendline. So that means i have two trendlines in two plots. Assume that time is z and x is...
  36. M

    I Relativistic particle in non-uniform magnetic field (math)

    Hi everyone, I am currently working on a project in Physics analyzing the possibility of magnetic fields protecting against radiation particles such as fully ionized nuclei or electrons. I wrote a code in Matlab that simulates a 3-D magnetic field based on a combination of wires and wire loops...
  37. W

    MATLAB Plotting animations (time-evolution)

    Hi all, I have a spatial probability density function that is dependent on ##x##, space and ##t##, time. I am able to make a plot for spatial probability density for each point in time by specifying ##t## values by using the fplot function. However, I want an animation that allows me to see...
  38. M

    MATLAB Numerical Integration with variable limits MATLAB

    Hi PF! Suppose I have two functions ##f(x),\,g(y)## that are numerically defined as vectors (i.e. ##g(y) = [0,1,4,9,16]:y = [0,1,2,3,4]## and say ##f(x) = [0,1,8,27,64]:x = [0,1,2,3,4]##) and am trying to compute $$\int_0^1 f(x) \int_x^1 g(y)\, dydx.$$ How would I do this in MATLAB? I could be...
  39. starstruck_

    MATLAB Using MATLAB outside of the lab

    This is a pretty dumb question, but I honestly just need some advice as to which option to go for. I'm in first year and one of my courses this term is computer science where we will be using matlab. Matlab isn't free- I know that, but my professor said we have two options available for us to...
  40. Cassius1n

    MATLAB Does anyone had this plotting problem with MATLAB?

    I have finsihed my work on an orbit propagator in MATLAB and now I'm trying to simulate the orbit with the help of the main script. tspan=[0 :860]; Position and velocity y0(1,1)= 743322.3616 ; y0(2,1)= -6346021.219 ...
  41. C

    MATLAB Help: Convert Matlab to Python code

    I'm working on a convolutional neural network project that classifies histopathological images of breast tumors. All my code is in python. Part of the image preprocessing involves appearance normalisation to account for the variation in histological staining. The only code for the preprocessing...
  42. J

    Compensator Design in system control

    Hello, in my final project for System Control i have been stuck for some time on this following task What i cannot figure out is how to make all these condition work at the same time. When I tried designing a PD controller in sisotool or MATLAB for the i and ii part it worked but i couldn't...
  43. C

    MATLAB function within function handle output

    Homework Statement MATLAB The funciton "rockdynamicstage" outputs a matrix 4 by x, where x is somthing around 300( varies). The funciton "rockdynamicstage" is within the funciton handle "sim" with an input of gama0. (PayMass,Masstages,Massfrac,Thstage,IspStage,ChangeTstage) ar parameters that...
  44. Jayalk97

    Problems designing an FIR band pass filter on MATLAB?

    Homework Statement So I've been tasked with designing and band pass filter for my signals class. We're given the specifications that it needs to go from 200-5000Hz, and we need to use a kaiser window as the window function. Homework Equations There are 2 parameters, beta and N, given by these...
  45. F

    MATLAB Symbolic calculations in MATLAB

    Hello Everyone, I am not sure of when to use symbolic calculation and symbolic function in Matlab. For instance, we can set the domain of a function x=1:10 and plot the function y= x.^3+3 numerically to plot a graph and calculate numerically the derivatives, etc. That said, I am not sure of...
  46. D

    MATLAB Mastering Matlab: Graphing Functions Made Easy

    The MATLAB command plot plots points in a two-dimensional figure and connects them with straight line segments. So, here $y$ is a vector with $n$ entries $(1; y(1)); (2; y(2)); (3; y(3)); : : : ; (n; y(n)):$ So the MATLAB command is given below for an example: y = [1 -3 3 -4]; >> plot(y)...
  47. D

    MATLAB Matlab Sim Code for ODE & Gillespie for Reversible Reaction

    Here is the code you input into matlab. Aini etc, are the initial values of the population densities. A for predator, B for Prey. % example for ODE and Gillespie % one reversible reaction b1 = .033; bo = .00047; a1 = .0022; ao = .00055; Aini = 5168; Bini = 34; %% Basic ODE simulation...
  48. TaylorLL

    MATLAB MATLab: Not enough inputs for nlinfit

    Hello! I'm trying to plot a best fit for some generated EQ data and I'm having issues with nlinfit. My code is as follows and when I try to run it, I get an error referring to the anonymous function ("test"), nlinfit (from Matlab), and not having enough input arguments. %Test function t =...
  49. D

    MATLAB Matlab code for a Gillespie type reaction (model) with wolves and elk.

    Copy and paste if you want to use any of this code. Its a simple iteration of converting biomass of elk into new wolves. % example for ODE and Gillespie % one reversible reaction b1 = .033; bo = .00047; a1 = .0022; ao = .00055; Aini = 5168; Bini = 34; %% Basic ODE simulation dt = 0.01...
  50. PainterGuy

    MATLAB Fixing a Matlab Code: Help Needed for Fourier Transform Calculation"

    Hi Could you please help me to fix the code below? I know that the code is completely wrong but I have tried to write it down so that you can get an idea what I'm trying to do. Thank you. %%file name fourier.m clear all; close all; clc; f = 0; %% 0 Hz to 100 Hz, with 0.1 step...
Back
Top