Matlab Definition and 1000 Threads

  1. J

    MATLAB 3D Diffusion Equation in MATLAB

    Hi guys, I have functioning MATLAB code for my solution of the 3D Diffusion equation (using a 3D Fourier transform and Crank-Nicolsen) that runs just from the command window and automatically plots the results. However, it seems like my solution just decays to zero regardless of what initial...
  2. W

    Bungee jump -> differential equation -> simulink simulation

    Hello guys, I found this forum using google because I need help with simulating bungee jump model. I've already done that with zero initial values and it looks good but I want it more realistic : Let's say L is the length of rope so elasticity force starts acting when y=L so logically time...
  3. L

    MATLAB Help with Integral and MATLAB Equation using Real Numbers

    I carried out a physics experiment and I wanted to analysis the problem with matlab. I have some code in MATLAB that "works" as in it gives ok result but the numbers used are quite nonsensical, I need help making the reworking the equation with real numbers. I am not sure if this is the correct...
  4. goonking

    MATLAB How to add normal vectors/quivers to sphere in matlab?

    so I got my sphere, centered at (1,-2,0) with radius 3 how do I put normal vectors/arrows onto my sphere's surface? I tried quiver3(x,y,z)
  5. m.r.fouladi

    MATLAB BioHeat Equation solution in MATLAB using pdepe

    We have this Equation as bioheat equation: ∂T/∂t = α ∇2T + 1/ρc[S+Sp+Sm] and also this: Sp=mbcb(Tab-T) that all α,ρ,c,S,Sm,mb,cb,Tab are constants, now I want to solve this equation in conditions below with pdepe in MATLAB: There is a Tumor as a sphere with radius 1 cm exactly in center of a...
  6. seyfi

    4th ODE runge kutta (hiemenz equation)

    Hi all i want to write a MATLAB code by runge kutta solution for hiemenz equation. F''' + FF'' + 1 - F'^2 = 0 BCs F(0)=F'(0)=0 and F'(inf)=1 I have programmed for RK Fehlberg, RK4 and RK5 method but the results of these three methods are not matching with actual values. In the cod I defined...
  7. Junichirol

    Matlab (calculate natural frequencies using eig function)

    Homework Statement Determine the corresponding natural frequencies M = [1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1]; C = [2 0 0 0;0 0 0 0;0 0 0 0; 0 0 0 0]; K = [10 -5 0 0;-5 10 -5 0;0 -5 10 -5;0 0 -5 10]; Homework Equations A = [zeros (4) eye(4); -M/K -M/C] [V,D] = eig(A) The Attempt at a Solution just...
  8. J

    Fourier series of square wave on Matlab?

    Homework Statement How Can i do this on matlap the question in Attached files Homework Equations The Attempt at a Solution i try a lot but i failed
  9. P

    Modeling Motion of Earth with Matlab using ODE45

    Homework Statement So I am trying to model the motion of the Earth around the Sun using ode45. I modeled this using an euler-cromer scheme, but I would like to get familiar with using a solver. I wrote the code for an Euler-cromer and it worked just fine. However, when I try to use the same...
  10. H

    MATLAB Matlab ode solvers - adding a separate convergence criteria

    Hi, is there a way to add a user defined convergence criteria to an ode solver so that the solution is stopped?
  11. I

    MATLAB Polynomials in Matlab - Plotting Results

    y = [0.053 1.477 1.970 3.279 4.153 4.934 5.178 5.828 6.082 6.484]; % data coef = polyfit(x,y,3) X=0:.1:9; Y=polyval(coef,X); plot(x,y,'o',X,Y) that's my code. did i do it right?
  12. I

    MATLAB Linear Interpolation in MATLAB: Troubleshooting and Tips

    hi! here's my question. here's my code. i have no idea what to do now :( x = 0:9; y = [0.053 1.477 1.970 3.279 4.153 4.934 5.178 5.828 6.082 6.484]; % data X = linspace(0,8.5,1); Y = interp1(x,y,X,'pchip')
  13. Arman777

    MATLAB Getting Started with Spline Fit in Matlab

    Hi Everyone I am Arman.I am at first grade in Physics and I have trouble to understand Matlab.Now we did Energy Conservation Experiment.I draw x-t and F-t graphs using matlab.Instructor told us we should use spline fit to draw a F-t graph.I don't have a toolbox about it.She told us some code...
  14. kelvin490

    Problem of plotting picture and video in Linux HPC

    I have a Matlab program that reads data file and then create avi. files and tiff pictures. It runs without problem in window OS using R2014a but cannot run in a Linux high performance computer(HPC). When the Matlab in Linux is started there are two warnings: Warning: No display specified. You...
  15. E

    Using the Fourier Transform on Partitioned Images

    If I cut my image into several portions and use the Fast Fourier Transform on each portioned image, will I achieve the same result as if I used Fast Fourier Transform on the whole image? I have this concern because I need to process a large image using the Fast Fourier Transform, the problem is...
  16. D

    MATLAB How to Calculate the Average of the Third Column in a Text File Using Matlab?

    I want to create a Matlab script called hw11.m, which reads in a text file of weather information, parses it, and writes formatted summary information. The textfile is called MonthlyHistory.html I cannot figure out how to write a loop that averages the third set of numbers in the string. an...
  17. ElijahRockers

    Neurologist: What P-values should I be expecting?

    Inexperienced data analyst here with a real-world example, I have attached a zip-file with screenshots and p-values of the following data. The "reference regions" are Cerebellum White, Cerebellum Gray, and Temporal Cortex. The top-most graphs depict the curves in the indicated region for young...
  18. N

    Why Does MATLAB Show NaN for Truss Deflections?

    Homework Statement I'm using MATLAB to design a truss and the output is suppose to be the deflections caused by the applied loads. But I keep getting "not a number" for my deflections . here is the warnings I get. Warning: System may be partially constrained. > In truss3 (line 222) In...
  19. kostoglotov

    Backwards difference matrix divided by negative delta x?

    An exercise in my text requires me to (in MATLAB) generate a numeric solution to a given second order differential equation in three different ways using a forwards, centered and backwards difference matrix. I got reasonable answers for \vec{u} that agreed with each other (approximately) for the...
  20. N

    Building a truss with matlab -- Need help

    Homework Statement I am suppose to build a truss using a MATLAB code given to me. I have to identify the joint coordinates, member assembly, and load matrix. The code is suppose to calculate the deflections like fea. I have put everything in but when the code runs my deflections are "NaN" which...
  21. R

    How to Input and Display a Matrix in Matlab?

    Homework Statement I have to make program that a user inputs a matrix and program displays it.Homework EquationsThe Attempt at a Solution I know the logic as in c++ I am able to display that. Here, m=input('Enter rows of matrix'); % Why not double quotes here as in cout of C++? n=input('Enter...
  22. kostoglotov

    Graphing Eigenvectors and Sine Curves: Understanding the Relationship

    In my text, it tells me to find the eigenvectors of a 2nd difference matrix and graph the eigenvectors to see how they fall onto sine curves. imgur link: http://i.imgur.com/oxbkTn6.jpg My question is simple but general. What does this even mean? How did they produce this graph from the...
  23. I

    Python Solving 3D Geometry Problems with Python

    Homework Statement Requirements: http://i.imgur.com/2WKyhto.png Homework Equations 2(L * W + L * H + W * H) SA = (2 * pi * radius * height + 2 * pi * radius^2) height = (volume)/(pi * radius^2) The Attempt at a Solution Code link: http://pastebin.com/sKFEGN0C
  24. P

    Calculate Reflectance and Plot R with Wavelength using MATLAB - Homework Help"

    Homework Statement i want to make MATLAB coding which is similar to this program. --> http://www.filmetrics.com/reflectance-calculator if i put n layers which is consists of each different n(refractive index), l(length), then it will calculate M=M1*M2+M3...*Mn, and calculate R. and plot R with...
  25. I

    MATLAB Matlab polar to rectangular coordinates

    Prepare a function m-file containing a function that converts polar coordinates in two-dimensional space to rectangular (Cartesian) coordinates. Include a suitable H1 line and some additional comment lines. The input will be 2 vectors, and the output will be 2 vectors. The length of each vector...
  26. I

    Matlab running out of memory on code

    Homework Statement I am trying to run code for the code below but MATLAB runs out of data. The Attempt at a Solution NumberOfVariables = 9; k=NumberOfVariables^2-NumberOfVariables+1; integers = 0:k-1; numbers = 1:k-1; tic s = combnk(integers,NumberOfVariables); AllAnswers = []; for i =...
  27. P

    OpenBLAS crashes on Ubuntu 15.04

    Whenever I try to reduce, invert, or factorize matrices of size 10000x10000 my whole system suddenly restarts without any error message. This happens on both julia and MATLAB when I run the command A=rand(10000,10000)^-1; I suspect the problem is due to the linear algebra libraries (I have...
  28. E

    MATLAB 2D diffusion equation, for matlab code.

    https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/12204847_801668796608594_2127169351_n.jpg?oh=f6ea92a40c93e4d843a4bf26a358677d&oe=56404FC5
  29. evinda

    MATLAB Troubleshooting a MATLAB Error: Inner Matrix Dimensions Must Agree

    Hello! (Wave) I have written the following code in matlab: function v=uexact(x,t) v=sin(2*pi*x)*exp(-4*pi^2*t); end function [ex]=test3 h = 1/50; T=1/2500; x=0:h:1; t=0:T:1; ex=uexact(x,t); end I...
  30. Tone L

    MATLAB Solving MATLAB Loop with X & Latitudes

    I have a list of latitudes: lats = 41.0100000000000 43.7800000000000 44.4200000000000 41.2500000000000 42.8000000000000 42.7500000000000 42.4900000000000 42.4900000000000 42.7800000000000...
  31. kelvin490

    MATLAB MATLAB how to automatically read a number of files

    I would like to plot a number of 3D graphs from different data files. For example I am using fid = fopen('SS 1.dat','r'); to read the first file and then plot a graph. How to set the program to change the name to 'SS 2.dat' automatically? Also for the tenth file the name becomes 'SS 10.dat'...
  32. kelvin490

    MATLAB MATLAB movie2avi cannot made video

    I am trying to test the function movie2avi using simple codes in R2014a as follows: clear; close all; figure; Z = peaks; surf(Z); axis tight manual; ax = gca; ax.NextPlot = 'replaceChildren'; loops = 40; F(loops) = struct('cdata',[],'colormap',[]); for j = 1:loops X =...
  33. C

    MATLAB Is 2GB ram enough to work on C language and matlab

    Hello everyone I am going to buy a computer soon. And because I don't have much money, computer s ram can be 4 GB at most and which will cause me some trouble. My question is that will 2gb ram be enough to work on MATLAB and learning to code.
  34. M

    I want to find the vector components of an MRI pixel -- How?

    I have a Dicom Image that is interpreted as an array. Each cell is a pixel. Each pixel has a value. I want to find the vector components (x,y,z) of a pixel. Specifically, I want to find magnetic field vectors for each pixel. The image is for H1 atoms. Freq = 297, B0 = 3. How would you do this...
  35. T

    Simple 4 bus Newton-Raphson matlab not converging

    Homework Statement All the necessary data is in the code, I'm just trying to converge NR, I decided to use the equation S = V^2 / Z since I had the admittance matrix and powers (needed voltages) I think my simple algorithm has a slight issue I can't find. Homework Equations Thank you! The...
  36. A

    MATLAB How to plot text file in MATLAB

    I had to use a network analyzer measuring the standing wave pattern along a transmission line taking data points at half mm increments. The software I used got me the values in a text file and the way it is formatted, I can't figure out how to make the left side the X axis and right side the Y...
  37. L

    MATLAB Calculating Triple Correlation in MATLAB for Three Signals

    Hello, How can I calculate a triple correlation between 3 signals A,B,C (each has 2 million samples)? I know xcorr do it for 2 signals by FFT each signal, multiplication and iFFT back. Since xcorr cannot do it for three signals, I try to do it "manually" by the above algorithm. So, the "regular"...
  38. R

    Convert ECI to ECEF: A Step-By-Step Guide

    I have done a search online to understand how to convert ECI to ECEF. I wanted to learn what the conversion is so I could just create a MATLAB script to make it happen. My problem is that most of the information I find assumes you already have some knowledge about ECI and ECEF. If I had more...
  39. kelvin490

    MATLAB Enlarging & Repositioning Figures in MATLAB

    I want to create figure that is enlarged, I use: fig = figure(1);%These two lines maximize the figure dialogue set(fig,'Units','normalized','Position',[0,0,1,1]); Then I use zoom(1.9); to enlarge the figure The dialogue is enlarged. But I want to reposition it just like use the "pan" button...
  40. T

    MATLAB Resolving MATLAB Plotting Issue with Velocity & Position

    I am trying to plot the magnitude of velocity and position against time but keep running into issues. The error I am getting here is: Subscript indices must either be real positive integers or logicals. Error in project2 (line 46) position(t) = w(1:3);Here is the relevant portion of my...
  41. H

    MATLAB How can I position text on multiple Matlab plots with different scales?

    I want to have three plot 1,2,3 in Matlab with the symbols (a), (b) and (c) on plots 1, 2 and 3 respectively.I can do it by text('(a)'), text('(b)'), text('(c)') on the plot 1,2 and 3 respectively but I want to have the three symbols on the same position on the three plots for example...
  42. lep11

    Matlab data-analysis problems (systematic error, distributions)

    Homework Statement I have a few data-analysis problems due to Thursday, 1. Assume that a sandbag is dropped at different heights and the observations are (z i;ti) pairs. Physical model for a free fall is z=½gt2. Assume that the height measurement z has an additive random error v. The...
  43. T

    Runge-Kutta method - Orbital mechanics

    Homework Statement Given: Initial orbital elements of a satellite a=6652.555663km; e=0.075; i=28.5 degrees; Ω=40 degrees; w=30 degrees; n=0 degrees;Tasks(using MATLAB): 1. Convert orbital elements to position and velocity vectors 2. Use these vectors to initialize the Runge-Kutta...
  44. R

    MATLAB Fit with implicit nonlinear function - Matlab

    Hi guys! I am trying to fit a function whose x data depends nonlinearly on the parameter of the fit and I am having hard time doing that! I will explain better: from my experiment I was able to measure my ydata e my x0 array and I know that my xdata are: x=x0+a/(1+4x^2), with a being a...
  45. I

    MATLAB Matlab Switch w/ string function

    hey hey :) So this is the code i came up with %% part 2 x=[1 2 3 4 5]; % 1 is freshman % 2 is softmore % 3 is junior % 4 is senior % >4 is super senior for i=1:5 s=input('number: '); switch s case 1 yearNumber='freshman'; case 2...
  46. N

    MATLAB Plotting Complex Wavefunction - Matlab

    Hi, I am wondering how to plot a complex function of the form: Ψ(t) = Ansin(n⋅pi⋅x/L)e-iEnt/h + Bnsin(m⋅pi⋅x/L)e-iEmt/h + ... + where m and n are known eigenvalues of the infinite square well with corresponding energy En, for any particular x? So, this will be a function of solely t. Any help...
  47. CuppaMuons

    What should I choose as the error on x? (Curve Fitting Matlab)

    Homework Statement So I've done an experiment by scanning over a range of angle and measuring the intensity of X-Rays. There are peaks where I have X-Ray diffraction occurring and in order to do analysis I need to identify the values of angle and an error (as in the plus/minus) on this value...
  48. M

    IsPalindrome: Matlab Function to Check Word

    I am trying to write a function called ispalindrome, with Matlab, It is supposed to check if a word is a palindrom or not. It will then return a value True (1)or False(0) for each word. I have tried to run this, but something seems to be wrong... function isPalindrome (word) word =...
  49. T

    Finding roots using Newton's method in MATLAB

    Homework Statement I am supposed to find the roots of the equation: 10esinx = x2 - 5x +4 in MATLAB using Newton's method with a tolerance of 10-8. There should be three roots. Homework Equations p=po - f(po)/f'(po) |p - po| < TOL The Attempt at a Solution Here is what I have for the code...
  50. H

    MATLAB Coding up a simple geometric algebra in MATLAB

    Hi, I have been wanting to do this for a while but not too sure how to go about it. I have the following geometric algebra \lbrace\mathbf{e}_{i}\rbrace_{i=0}^{3} which satisfy the following relations: \mathbf{e}_{i}\mathbf{e}_{j}=-\mathbf{e}_{j}\mathbf{e}_{i} and...
Back
Top