Matlab Definition and 1000 Threads

  1. A

    MATLAB Roots of Polynomials by loop in matlab

    Dear Friends! I need to find roots of polynomials with variable coefficients, The command I used is w=0:50 A=w^2 B=w^3+2 C=w+2*w^2 D=w E=w./2 ss=[A B C D E] xi=roots(ss) by this I find all the roots of equation, I want to find velocities by setting v1=w/xi(1) v2=w/xi(2) v3=w/xi(3) v4=w/xi(4)...
  2. J

    MATLAB Vector-valued functions in MATLAB

    I'm trying to create a vector field plot of an equation in x and y. Basically, I would like to create a function F(x, y) = p(x, y)i + q(x, y)j that defines a force field, and have the field direction and magnitude plotted at points in the x-y plane, and both components of the vector are...
  3. R

    Algorithm to compute Basis images of an image

    I know from the Fourier Analysis that any signal can be represented as summation of elementary signals i.e. basis functions .Likewise,any image can be represented as summation of Basis images. Is there any available code, or even an algorithm, that would allow me to compute Basis images of an...
  4. S

    MATLAB Can You Solve This Finite Difference Equation Using Matlab?

    hi dear i have a question. i have equation (1/α ) dT/dt =d2T/dr2 +1/r dT/dr +d2T/dz T=T(r,z) T(Ri,z)=Ti T(Ro,z)=To T(r,0)=To dT(r,L)/dz =0 by finite difference method O(h^3) and this question's MATLAB program. is there anyone who can do it ? it is very important for me tnx
  5. A

    MATLAB Matlab: Finding the right angle

    Hi! I have a question about an assignment. It is about throwing a rock which should land 20 meters away from the "shooter". My job is to find the angle "a" which makes the rock land 20 meters away. The motion is given by a multivariable, second order differential equation which I have already...
  6. K

    Solving PDEPE without boundary conditions? heat transfer

    Hi all! I am trying to solve a system of partial differential equations in Matlab, with both derivatives in time and space domains. I am using the pdepe function for that. The system is, to be simple, a sort of solar thermal panel, made of three layers: an absorber plate, a fluid layer of...
  7. R

    Decomposing Images into Harmonic Components Using Fourier Transform

    I am beginer in image processing. Any signal whether it is 1D,2D or any multidimensional signal can be represented using combination of number of sine and cosine wavesforms (harmonics).Similerly any image can be termed as a function of sinusoidal signals.I want to see individual pattern for the...
  8. B

    Unsteady vorticity transport equation: codes available?

    I would like to reproduce results from a much older code to test a new one. I only have the old code's results in the form of plots, not data, but I need data. The older code solves the unsteady vorticity transport equation in 2D with a constant kinematic viscosity term. I'm interested in 2-D...
  9. lonely_nucleus

    MATLAB How long does it take to get good at matlab?

    is learning MATLAB like learning c++ where it takes like a year of programming everyday to get good at or is it a smaller programming language? I just finished learning html at codeacademy.com and it was very easy to learn and I learned it fast, is MATLAB larger than html? If you used MATLAB...
  10. D

    PC Characteristics: Simulation FEM professional purpose

    Dear all, I'm an electric engineer, and I usually work with software as Ansoft Maxwell, Matlab, Ansys, COMSOL... I need a PC for serious professional simulation, and I would like if someone can give me some tips of the characteristics I should ask for this purpose. I don't want to spend more...
  11. H

    MATLAB Set Axis Font Size Independently in Matlab

    To set axis font size I use set(gca,'FontSize',20) but this command also acts on legend font size. How to set axis font size independently?
  12. T

    Matlab code running loops to meet conditions

    Homework Statement This is not homework but I am trying to solve a problem to see to general a set of numbers for the grassmanian equations to use in something else.[/B] I have five variables a,b,c,d,e. a-b,a-c,a-d,a-e,b-a,b-c,...etc so that none of them are the same so it generates all...
  13. Feodalherren

    Efficient Matrix Multiplication with Nested Functions for MATLAB Homework

    Homework Statement Homework Equations [/B] ---------------------- [FONT=Courier New]function [C]=mymatmult(A,B) [L1 C1]=size(A); [L2 C2]=size(B); if C1 ~= L2 error('dimension mismatch'); end %if ERROR C=zeros(L1,C2); for i=1:L1 for j=1:C2 C(i,j)=A(i,:)*B(:,j); end %in for end %out...
  14. M

    MATLAB Solve PDE in MATLAB: Errors & Tips

    Hi all, I'm a newbie at MATLAB and currently trying to model a chromatographic process, I have a PDE to be solved in the form of c*D(C_RH)/Dz = D(f)/Dz + s (see code below for what functions c, f and s are made of) I have defined constant values for each of the individual parameters...
  15. lonely_nucleus

    MATLAB Free MATLAB for HS Students: Can You Use It?

    I am interested in doing some MATLAB programming but I cannot afford to buy the software. Can HS students use MATLAB for free?
  16. S

    Ziegler nichols method (PID control)

    hello there, i just want to ask some questions related to PID controller. currently, i have run zumo robot to detect line by using PID controller approach ziegler nichols method..however, by testing P,PI, and PID, P gives the most accurate when zumo follows the line..which is better actually? P...
  17. Bababarghi

    MATLAB Transfer equations from MathType to Matlab

    Hi, Has anyone tried to paste equations from MathType into Matlab ? I follow every step described here No matter what equation I paste, I get following error in Matlab: | Error: The input character is not valid in MATLAB statements or expressions.
  18. jdawg

    Solve Matlab Eigenvectors Homework

    Homework Statement I think this problem is supposed to be pretty simple, but I have almost no knowledge of how to use matlab. I was told to use this function: [V,D]=eig(A) to give me the eigenvectors (columns of matrix V) and the diagonal matrix with eigenvales in the diagonal ( matrix D). I...
  19. D

    MATLAB Matlab - calculate phase shift using fft

    hello, I have 3 signals in the form of sampled values. When I plot them using plot (t,vPa,t,vPb,t,vPc) where vPa, vPb, vPc contains the values and t contains the sampling istants I get this: when I calculate phase shift using fft I get phase angle = 0. I have tried using my own code ( which...
  20. N

    Matlab Simulink: Simulate the height of ball thrown upward

    Homework Statement Upthrow simulation Conditions: initial velocity v=10m/s, initial height h=0m when t=0. Gravity acceleration g=10m/s2 . Using Simulink to simulate the variation of height with time when t≥0. Homework Equations I figured that the governing equation should be: Height =...
  21. B

    MATLAB How to calculate equation system in Matlab, with some knowns

    It's part of finite elements analysis. All I need is to solve F=Ku,K is [12x12] matrix . Some of the members of u are zeros ,some members of F are known forces . K is all known . How do I solve F=Ku in that way ?? Thanks in advance.
  22. B

    Matlab User-defined function problem

    Homework Statement Write a user-defined function that calculates grade point average (GPA) on a scale of 0 to 4 ... https://41.media.tumblr.com/4f5e8ee38181d7c584c234138f632714/tumblr_nmnhq9p8jo1usetlso1_1280.png The Attempt at a Solution I'm getting the error that "function definitions are...
  23. W

    MATLAB Converting Excel formulae into Matlab code

    Hi everyone, I will start off by saying that I am a complete novice in Matlab and prefer to use Excel however the data that I have requires more computing power than Excel can provide. I have 16 sets of data with over 70,000 rows and 9 columns. The first column is a time series separated into...
  24. B

    MATLAB [MATLAB] Modeling response of a particle in an anharmonic potential

    I'm trying to model the response of a particle in an anharmonic potential in MATLAB. I know that writing position, x as a function of potential energy U is, where T is the period, m is mass, and E is the energy of the system. How would I get a function for T(E) since it's not independent of...
  25. H

    MATLAB Bar plot in Matlab with specified values on the x-axis

    In the plot below x=.1:.01:.2; y=5:15; bar(x,y) I like all the values of x to be displayed on the x-axis. For example by plotting this bar, the values of x=0.11,0.13, 0.15, 0.17, 0.19 are not displayed on the x-axis. I appreciate any help.
  26. H

    MATLAB How to plot a continuous zero plot in Matlab?

    In the plot command below x=1:5:100 plot(x,y,x,0) one plot is noncontinuous zero plot. How can I plot a continuous zero one?
  27. C

    MATLAB Getting Started with Matlab Image Analysis

    Hello everyone, I just started learning Matlab and I am trying to figure out how to image analyze an STM file. Where do I begin? Thank you, Michelle
  28. A

    MATLAB MatLab: array of numbers unequal distribution

    I want to create an array of numbers between 0 and 0.1 where the points are clustered around an arbitrary point x1 (0 < x1 < 0.1). I want the points to get exponentially closer together near x1 from either side and and get further apart towards the outer limits. I am using MatLab and was trying...
  29. Feodalherren

    MATLAB For Loops Homework: Solving Arbitrary Matrices

    Homework Statement Homework Equations - The Attempt at a Solution I've been trying several different ways but I just can't seem to figure this one out. It seems to me like I will need nested for loops, which we haven't learned yet. The way I read the question is that this program needs to...
  30. T

    MATLAB Curve Fitting with Matlab: Tips and Tutorials

    http://postimg.org/image/6zlab4elj/ I have x and y data for the red curve and I want to fit that data to the custom equations in the red boxes. I am trying to use lsqcurvefit to do this but I'm new and I don't know how to use it. Does anyone know any videos that would help?
  31. Feodalherren

    MATLAB: Plot vectors from a function

    Homework Statement So I have a function that allows me to input two vectors and it will calculate the resultant vector. The code works fine. I need to call on this function and plot the two input vectors and the resultant; it's easier to explain if you look at the code. Homework EquationsThe...
  32. D

    Numerical Solution for Nonlinear BVP with Polynomial D(x) in Matlab

    Homework Statement Solve from the differential equation below numerically for the function \phi(x) for x \in [0,L] \phi '' (x) + D(x) sin(\phi (x) ) + E sin(\phi (x) ) cos( \phi (x) ) = 0 with D(x) a polynomial. Homework Equations Matlab. The Attempt at a Solution I can rewrite it in a...
  33. S

    Issue Finding the Mean Squared Error / Polyfit MATLAB

    Homework Statement Homework Equations Given above The Attempt at a Solution I used polyfit, but my mean swuare errors are way bigger than they should be- don't see what is wrong with my code! My code is ugly btw, my apologies. %Hw 7 clear all close all y3=[1960; 1965; 1970; 1975; 1980...
  34. I

    MATLAB How can I solve a 2nd order ODE in matrix form using Matlab?

    I'm trying to solve a 2nd order differential equation in matrix form. I'm not familiar with Matlab, and have tried solving this using tutorials on youtube. Initially, theta1 = pi/4, theta2 = 7*pi/12, theta1_d = 0, and theta2_d =0. Time interval is (0,1.2). When I try to solve this using ode45...
  35. J

    How to get specific frequency and time values for .wav file

    How to get specific frequency and time values for .wav file and export the values as .csv? Problem: I need to analyze this music .wav file, particularly for its frequency, amplitude, and pitch over specific intervals of time. Is there any easy to use software and steps I can take that can...
  36. C

    MATLAB Learning Matlab: A Beginner's Guide

    Hi everyone! Well, I'm a chemist and..I don't know too much about programing but i can't keep using origin for everything...it just take so much time sometimes so I want to learn Matlab and I would like to know if anyone here could recommend me a website or something to use as a starting...
  37. W

    MATLAB Matlab summation of a complex function

    Hi, I need to plot the last function of this: But I don't know how to generate the sum. I know the for loop is totally wrong, but I can't go any further. This is what I have: Can someone fix the summation loop part for me? Thanks in advance
  38. S

    Error Analysis of Modern Gram Schmidt Technique -code bug

    Hi all, I am to compute A = QR using the Modified Gram-Schmidt algorithm. I need to find the error using the one norm of : (Q transpose * Q) - I. Here is my code: %Modern Gram Schmidt p=zeros(5,5); e=zeros(5,5); g=zeros(5,5); for k=1:n; p(:,k)=(A(:,k)); end %j=k, i=u, r=g, q=e, v=p for...
  39. B

    MATLAB Simplify Matlab for/if statements further

    Hi Folks, This loop code is working fine but I would like to simplify it further. Can anyone help? Basically, i need syntax to automate the numbers highlighted in bold. k is a 3*3 matrix, SE_ans is a 3*1 vector, A is a 3*3 identify matrix. The rests are just constants. for i=1:size(k,1)...
  40. H

    MATLAB Unexpected inequality in Matlab

    In the program below, the result of "difr" is not zero but according to the definition of qx in the second line, I expect it to be zero (because qx^2+ky^2=(\frac{ef-u}{hbarv_f})^2). What is the problem? ef=1;hbarv_f=658;ky=0.0011;u=2.5; qx=sqrt(((ef-u)/hbarv_f)^2-ky.^2)...
  41. H

    MATLAB Unexpected result of the "find" command in Matlab

    The program below gives "error=4 7" unexpectedly while all the arrays of "real" are 1! I would be grateful for any help. kky=pi/(2*10000):pi/10000:1/658; ky=[-fliplr(kky) kky]; kx=sqrt((1/658)^2-ky.^2); expiphi_1=(658/1)*(kx+i*ky); real=expiphi_1.*conj(expiphi_1) error=find(real~=1)
  42. JohnPrior3

    Gambler's Ruin in Matlab: Solving the Loop Problem

    For Matlab, I need to write a program where a Gambler starts with 5 dollars and runs out with 1 dollar bets. The house has favorable odds of 70/30. I have gotten very far, but I can't find out how to end the loop when the gambler reaches 0. Here is my script: A = 5 n=100; x=rand(1,n)...
  43. H

    MATLAB How Can I Manage Multiple Figures in One Window in Matlab?

    After saving several Matlab figures (with the format of Matlab Figure) how can I put all of them in one window to compare together? And what should I do to see the file names on the figure when I saved them?
  44. Adrian Soo

    MATLAB Piecewise MATLAB ode45 problem for Lennard-Jones

    I could run the MATLAB codes but the main issue is that data for T1 and U1 could not be produced. I am currently trying to calculate the displacement of two particles after the collision with walls with length of 10 units. Here are the codes. If you don't understand its context, you can refer...
  45. E

    MATLAB How to Modify Contour Colors in MATLAB?

    %gamma=20; gamma=580; %P=0.1; P=0.75; N=P.*gamma; lamdazero=1550; [lamdapump,lamdasignal] = meshgrid(1550:0.1:1700,1550:0.1:1700); beta3=1.3; beta4=-8*10^-4; %beta3=0.06; %beta4=-2*10^-4; c=2*pi*3*10^8; %L=1; L=0.01; A0=(1./lamdapump) -(1./lamdazero); B0=(1./lamdapump) -(1./lamdasignal)...
  46. E

    MATLAB Highlighting a Specific Region on a Matlab Plot with Contour Question

    Hello everyone If I have a plot of a function of two variables and I want the whole curve over the whole x and y intervals but in addition I want to highlight with a black colour a specific region when the function is between two values F between -8 and 0 or what ever How can I do that ...
  47. H

    MATLAB Matlab Linspace Problem: How to Control Ky-Points in Loops | Error Fix

    The following Matlab program clc clear all for ef=1:100 ky=linspace(-ef,ef,ef*2); for n=1:3 r(n,:)=2*ky; end end encounters this error: ? Subscripted assignment dimension mismatch. Error in ==> testarrays at 6 r(n,:)=2*ky; But if I use ky=linspace(-ef,ef); there is no error! why...
  48. beyondlight

    MATLAB Optimize code for a blob-detector (MATLAB)

    The blobdetector consist of the following functions: gaussImage: Filters a image with a gaussian filter gaussPyramid: Uses gaussImage to filter the same image several times with different std. diffOfGaussians: Uses gaussPyramid to compute the difference between consecutive filtered images...
  49. Feodalherren

    MATLAB: input arrays into function

    Homework Statement Homework EquationsThe Attempt at a Solution Okay, so first off I'm just trying to write the code for scalars: -------------------------------------- clc ; clear P = 2000 r = .035/12 n = 36 F = (1 + r).^n A = (r*P*F)/(F-1) --------------------------------------- This...
  50. N

    MATLAB Matlab script for central difference

    I am trying to write a script that will compute repeatedly, beginning with step size h=1 and then progressively divide the step size by a factor of 10 to demonstrate how round-off error becomes dominant as the step size is reduced. In using centered difference approximation of O(h2) to estimate...
Back
Top