Matlab Definition and 1000 Threads

  1. 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...
  2. 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...
  3. 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)...
  4. N

    Fourier transform power dependent on frequency

    Homework Statement this is something i noticed doing homework rather than homework itself. I plot fft output from different frequency signals, i am not sure why power changes with increasing frequency? Homework Equations if i take (with MATLAB notation): time = 0:0.01:10 y =...
  5. 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...
  6. 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(...
  7. 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...
  8. P

    Conversion from galactic coordinates to image coordinates

    Dear All I was wondering if anyone knew of a tool/library in Matlab that would enable me to convert from galactic to physical image coordinates. I can read the header file etc of a fits file but I am at a bit of a loss as how to use this information to get real image coordinates. Cheers Duane
  9. 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.*...
  10. M

    Troubleshooting 2D Conduction With Matlab and Interactive Heat Transfer

    Homework Statement I have to come up with a program that calculates the nodal temperatures of a sheet with a slot with 2D conduction. Due to symmetry the shape can be reduced to an L shape. Matlab and loops have always given me trouble, so I tried the Interactive Heat Transfer 4.0...
  11. 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...
  12. 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]?
  13. 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...
  14. M

    MATLAB [Matlab] dynamic change in formatting crop not showing

    I am trying to crop an image and be able to manipulate in some way (I adjusted contrast) and show change in formatting as its displayed beside the original image (by making it turn more and more blue). The code runs successfully, but it seems to already have made the cropped image as blue as...
  15. _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...
  16. 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...
  17. 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)...
  18. W

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

    Generally, How the ship motion is calculated base on MATLAB?
  19. 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...
  20. 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...
  21. 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...
  22. 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...
  23. 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')...
  24. 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?
  25. 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?
  26. 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), ...
  27. _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...
  28. 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...
  29. 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...
  30. 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...
  31. 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...
  32. 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...
  33. 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.
  34. 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...
  35. 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)...
  36. 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...
  37. 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 =...
  38. $

    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...
  39. 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...
  40. mesa

    Having difficult time trying to plot a simple trajecory

    Hello all, I am trying to plot a simple trajectory in MATlab. Here is the code I wrote, v0 = 100; theta = pi/4; t=0:0.1:20; horizontal(t)=t.*v0.*cos(theta) vertical(t)=t.*v0.*sin(theta)-4.905.*t.^2 %teacher gone missing, again, ARRRGGHHH! title('Ballistic Trajectory of a Projectile')...
  41. f95toli

    Software for creating graphs for presentations

    I was wondering if anyone has a suggestion for software that can be used to create good looking graphs for e.g Powerpoint presentations? | have access to a range of packages (Excel, Origin, Matlab) but none of them can create really "slick" locking graphs (but they are fine for figures in...
  42. E

    MATLAB Matlab Code for Time-Frequency Transformation

    Hello everyone. Sorry if the question is silly, but in really need to know something. We know that The Fourier transform of time is frequency and the inverse of frequency is time. In Matlab can anyone tell me how to write it ? Because in the book Non linear fiber optics by Agrawal we found that...
  43. M

    MATLAB How to Make Matlab Output Zero Coefficients in f=2x^2+1?

    Take f = 2x^2 + 1. When I run coeffs(f) in Matlab it outputs [2,1]. However I want it to output all the zero coefficients as well, for example [2 0 1] here. How do I do that?
  44. A

    MATLAB How to control power source base on load condition in Matlab/simulink

    hi i'm using Matlab/simulink to create a microgrid model which simulate dynamic control of power based on the loads. the loads are changing based on the realtime. I use several voltage sources to power the loads. I would like to be able to turn on/off the generator based on the loads. for...
  45. B

    MATLAB Help with MATLAB code; discrepancy between graph max and Matlab's max

    Hi, For some reason, when I run this MATLAB code, I'm getting what looks like about 10,000 for Rf for the largest Vo on the graph, but MATLAB is giving me Rf at (Vo)max as 100,001 Any ideas? clc; clear; close all; syms Rf Rf = 0:0.1:100000; VRt25 = 18.*(10000)./(10000 + Rf)...
  46. M

    MATLAB How Can I Automatically Load .mat Files in MATLAB?

    Hi, I have some *.mat files and I need to read them automatically, they are like: PT2020-RSK1.778-ZONE49.8962.mat PT2020-RSK2.776-ZONE47.5451.mat PT2020-RSK3.776-ZONE46.041.mat PT2020-RSK4.7695-ZONE56.5417.mat PT2020-RSK5.7667-ZONE48.1113.mat Are there any ways to load them...
  47. A

    MATLAB Help with MATLAB Error: "Subscript Indices Must Be Real Positive Integers

    http://i.snag.gy/FBeLq.jpg I've figured out the first part, (a), it's the second part (b) that's confusing- I've tried re-arranging the plot() function and also tinkering with y1 and y2 rather than y(t), as I get the error: "Subscript indices must either be real positive integers or logicals."...
  48. S

    MATLAB Benefits of DFT over FFT in MATLAB

    From what I have read, FFT seems to simply be faster than DFT, thus making DFT redundant. However, if computational speed is not an issue, are there any advantages of using DFT over FFT (such as increased precision, for example)?
  49. W

    MATLAB Vector concatenation without using a for loop (MATLAB)

    I have a variable number of vectors to concatenate in my Matlab model. Is there a way to do this without a for loop? The number will depend upon input parameters. Suggestions.
  50. E

    MATLAB MATLAB 3D Plotting: Tutorial & Help

    Hi Friends, The code below is for 2D ploting in Matlab, I want to change it in 3D, please if anyone know how to do this.let me know thanks in advancefigure(1); popcosts=[pop.Cost]; repcosts=[rep.Cost]; plot(popcosts(1,:),popcosts(2,:),'b.'); hold on; plot(repcosts(1,:),repcosts(2,:),'r*'); hold...
Back
Top