Code Definition and 908 Threads

  1. MathematicalPhysicist

    MATLAB Why Is My MATLAB Code Not Working?

    Hi I tried to run this code, but to aveil (both in MATLAB and in mathematica). In the attachment there's a printscreen of the code and the errors, can someone help me with this? Thanks.
  2. K

    MATLAB Can anyone with MATLAB installed test my code?

    Long story short, we have access to MATLAB on the computers on my campus. My plan was to code at home and return to campus to test my code, but a few things have come up that won't allow me to return to campus today. Deadline for an assignment is fast approaching (couple of hours), I just need...
  3. Z

    Deciphering a Code with Mathematical Patterns and Hidden Clues

    The code below refers to a location on our campus. I need help trying to go about decoding it. K4LI41H4II3131I4FJ4LF 4FLLBD4DIBHK9IHH3G6 I=9, Q=8, Z=O Hints: 1) Involves math to solve 2) There is a no character for space 3) D=D 4) Numbers have something to do with pi 5) Involves the...
  4. M

    Matlab code but i'm having problems puting in a loop

    Hi. i have seen similar questions on here but can't quite get them to apply to my problem i have wrote some MATLAB code but I'm having problems puting in a loop heres my code ----------------------------------------------------------------------------------------- clear clc for...
  5. P

    2D CFD Code Development with SIMPLER Algorithm and C

    Hi, I like to start writing 2d CFD code for laminar flow using SIMPLER algorithm using c. help me from where i get information abt grid generation methods and GUI. If anyone had written such codes can guide me.
  6. M

    Fixed Point iteration using matlab, whats wrong with my code?

    Fixed Point iteration using matlab, what's wrong with my code?? Homework Statement We are suppose to use MatLab to make a program using the fixed point iteration to find the root of an equation. I just can't figure out what I'm doing wrong here... I'm pretty sure a while loop is the...
  7. P

    Reading separate lines from txt file (C code)

    Homework Statement I want to read each line separately in a char array from a text file. As yet, the best I could do is to read the entire file in a single char array. How can I read each line in a separate array? Homework Equations The Attempt at a Solution #include <stdio.h>...
  8. J

    MATLAB MATLAB code (calculating displacement)

    Hey guys, I need help. Say i take a picture of a dot in a frame followed by another picture whereby the dot has moved to another spot in the frame. How do I calculate the distance between these 2 dots? At the end, i would have 2 jpeg images of the dot at 2 different locations. What I'm trying...
  9. J

    How to Terminate a While Loop in C Programming with a Printed Message or Value?

    Im using the c programming language and just wanted to ask a quick question. In a while loop how do you make the program terminate by printing a value or a message here's my code while ((fabs(func(x))>epsilon)) { if(deriv(x)==0) { print the last value of x and stop the whole program} else {...
  10. B

    1D advection-diffusion-need to check my code; any suggestions?

    1D advection-diffusion--need to check my code; any suggestions? Hi everyone: I am teaching myself transport/programming, and have created a simple program for 1-D advection-diffusion (constant velocity, diffusion coefficient, central differencing, Crank-Nicolson). I would like to check...
  11. R

    [Help] Consulting for new code

    I have to rewrite an old code in order to generalize it. This code basically will have a huge 4 blocks matrix (bigger means less approximations needed so when running in full glory will be in the order of the 8GB memory that I have) with a lot of zeros that need to be diagonalized. Later I...
  12. P

    Where can I find a draft of C code to measure frequency using PIC16F84?

    i want to use measure the frequency of the square wave input at RA4/T0CKI of PIC16F84. so how should i start writing the code? anyone can provide some draft of the c code? thanks.
  13. BobG

    Deciphering Drake's Message: Astronomers Solve Alien Code

    By 1960, new radio telescopes were capable of detecting radio signals from at least the nearest stars and scientists began to consider what a message from outer space might look like. Dr. Frank Drake (the originator of the Drake Equation) came up with this first attempt at what a message from...
  14. X

    LaTeX Can I use the Latex code used on this site on mine?

    I really like the math code this site uses to type out the mathematics. Is there a way I can install something on my website server so that I can use it when creating webpages? If so, how?
  15. F

    MATLAB Plot Maxwell-Boltzmann Equation w/ MATLAB Code

    Hi Guys, I am trying to plot a simple Maxwell-Boltzmann Equation curve that shows me the probability of opening an ion gated channel. The issue I am having is the output shows me just a linear horizontal line that is around 0.5 probability which makes no sense given my inputs. Please take...
  16. F

    Comp Sci Calculating the First Day of the Week using the Julian Method

    Hello... the is my code: #include<iostream.h> #include<iomanip.h> void show(int m, int w, int n) { cout<<endl<<"Sun Mon Tue Wed Thu Fri Sat\n"; cout<<setw((w*5)+1); for(int r=1;r<=(7-w);r++) cout<<r<<" "; int count=0...
  17. M

    Comp Sci C++ code; unforced damped oscillator

    Homework Statement I have an assignment to make a C++ program (I've never seen C++ before, and my professor has never taught it) that makes a set of displacement values corresponding to the motion of a damped oscillator. The function is: x = A*e^{(-\gamma*t/2)} * cos(\omega*t) where...
  18. C

    Java Is there a javascript or php code to remove browsing history?

    I want to remove my clients browsing history every time they access new pages from my website. is there any code, i keep searching the net and i can't find one.
  19. N

    Assembly code microprocessor 8088 for seven segment LED

    Homework Statement i've just started learning microprocessors, and we need to program the 7-segment LED to display numbers 0-9 in increments of 1 i'm trying to get a delay of 1second between each number (and i couldn't get it) e.g., number 1 displays for 1 second, then number 2 displays for...
  20. L

    LaTeX Debugging Latex Code: 28 Errors and Still Trying

    hi. not sure if this is the right forum. i have latex code that I'm trying to get to print but it's giving me 28 errors and i can't find any of them i've got it to display nice but I'm still getting 28 errors when i run and they're all apparently related to missing brackets and stuff but i...
  21. D

    Maple How to Change Code Indent Size in Maple

    If I want to indent my code, I use spacebar, but it doesn't do it enough. How can I change the indent size?
  22. R

    MATLAB Transforming a matlab code

    Hi fellows! I need a bit of help with transforming a MATLAB code that simulate magnetic field of two concentric solenoid TO a plot that simulate the magnetic fields of high voltage transmission lines (specificly two and four lines), how can it be modified? here is the code: % GKLmagnet2.m...
  23. D

    Fortran What does errorfmt mean when running Fortran g77 code?

    Hi, I received a code written in Fortran 77, and I am trying to compile it and run it using g77. It compiles easily with no errors, but I keep getting the following error when I execute errorfmt: read unexpected character apparent state: unit 5 named jeffin last format: (10X,D13.7) lately...
  24. M

    MATLAB We need a matlab code for a normalized gradient eq. help

    We need a MATLAB code for a normalized gradient eq. help! :) Hello, we need help in converting this normalized gradient equation into a MATLAB code. Please see the image. Thanks! :) http://img706.imageshack.us/img706/7998/thesisformula.jpg
  25. C

    Help With C Programming Output | Troubleshooting Solutions

    my attempt is (this is c programming) My output is really different. It gives the answer but not a detailed solution as the output above. Pls help me I really don't know how to show the long method :frown:
  26. S

    MATLAB Trying to speed up some MATLAB code

    Hi guys, I've got some MATLAB code that calculates the forward kinematics for a robotic arm. This calculation relies on the successive multiplication of a series of 4x4 matrices, and currently I have this coded (more or less) as: ... T(:,:, 1) = T0; for i = 2:njoints T(:,:, i+1) =...
  27. L

    LaTeX Why Doesn't My LaTeX Code Compile Correctly?

    hi i wrote the following code. i think it's fairly easy to understand what I am trying to get it to print. but LaTeX really doesn't like it. any advice? \documentclass[12pt]{report} \usepackage{float} \usepackage{multirow} \usepackage{graphicx} \usepackage{subfigure}...
  28. Helios

    Java Get Help with Java Script Code: Calculate Day Count Since 1922 Dec. 18

    Dear Computer People, I know nothing about Java. What I understand what "Java script" means is something that one can paste into an html document or web page. What I have is a Java script code that displays a day count since 1922 December 18. Here it is. <script> var montharray=new...
  29. W

    How to modify the following code?

    I can compile the following code, but I can not run it in my computer. How do change it? Thanks. module nrtype INTEGER, PARAMETER :: SP = KIND(1.0) INTEGER, PARAMETER :: DP = KIND(1.0D0) INTEGER, PARAMETER :: I4B = SELECTED_INT_KIND(9) INTEGER, PARAMETER :: I2B = SELECTED_INT_KIND(4)...
  30. A

    MATLAB Help! MATLAB Code for Rutherford Scattering Won't Run

    What's wrong with this MATLAB code for Rutherford scattering, it won't run for me! :( Hi, I can't do matlab...and have to plot the trajectory of alpha particles in rutherford scattering. I've made an attempt, but i know I've gone wrong somewhere. Could someone tell me how to fix it? I'd be...
  31. U

    What are all the possible 5-digit binary code combinations?

    Hi all. I recently am thinking of developing a compression software with extreme speed and compression. The simple principle behind the working of this software is that the software is converting the program into binary code. Then, five sets of 0s and 1s are converted into alphanumeric...
  32. C

    MATLAB How Can I Resolve Loop Stuck Issues in MATLAB's Shooting Method?

    Hi, I am trying to use the shooting method to determine the angle of a projectile. However for some values of distance and initial velocity my value for angles get stuck between two values. I want to put a piece of code into my shooting method which can either detect that my while loop has...
  33. M

    Any good short reads on optimisation of code? (math-specific)

    Hello I am trying to speed up a code which performs a number of tasks on a set of data. I am wondering if there are any resources on general rules and principles that can be used to speed up calculation times? I am having a real problem when there appear to be more than one way to code...
  34. P

    Recursion code for generating Gray Code in C

    Homework Statement I need to implement a recursive code for generating the Gray code for a given number of bits. For example, if the input bit is 1 it generates Gray code for 1 bit number i.e 0 and 1. Given 2, it generates Gray code for 2 bit numbers i.e 00 and 01 and so on. I don't...
  35. L

    Solving 2D Heat Diffusion Eqn w/ Finite Difference Method

    I have to write a FD expilicit method, for temp dist on 2D plane. I am trying to mod the 1D solver to 2D solver, the code below is a 1D solver. Any possible suggestions how it can be done? I initially, derived u(i,j+1) for 2D for in that derivation i,j corresponds to x,y... where as in 1D...
  36. J

    Code for fluid dynamic in 3D written in Scilab

    Hallo. I am new at forum, could please somebody send me a code for fluid dynamic in 3D written in Scilab, mathematica or Fortran. I will use it to start with learning!b Thaks, JG
  37. U

    Photon Tracking Code: Calc New dx, dy, dz after 1st Scatter

    Hello all, I'm working on coding a program that tracks photons based on Compton Scattering. However, I'm having an issue on how to deal with photons with multiple scatters. So, phi (polar) and theta (azimuthal) range from 0-pi/2 and 0-2pi, respectively, based on a random number generator...
  38. A

    This is not an error, but rather a statement about arrays.

    Homework Statement Suppose we have the following program segments: int *zPtr; int *aPtr = NULL; void *sPtr = NULL; int number,i; int z[5] = {1,2,3,4,5}; sPtr = z; point out the error of the following code: (a) ++zPtr; (b) number = zPtr; (c) number =...
  39. W

    LaTeX Latex code for Hermitian Conjugate

    Hi there, Does anyone know the Latex code for Hermitian conjugate (dagger) on TeXniccenter? Thank you!
  40. W

    MATLAB Matlab ADI Method Code | Get Help with Troubleshooting

    Hi, I've been having some difficulty with Matlab. I keep getting confused with the indexing and the loops. To set up the code, I am trying to implement the ADI method for a 2-D heat equation (u_t=u_xx+u_yy+f(x,y,t)). I have Dirichlet boundary conditions on the left, upper, and lower...
  41. N

    F90/C Weighted Linear Regression Code

    Hi Guys, Can anyone recommend a code, preferably in fortran 90/77, or possibly in C, which provides a weighted linear regression of a 3 column file? Natski
  42. P

    LaTeX Troubleshooting Latex Code: Poor Quality and Unreadable Output

    am I having a problem with it? The quality of it is so bad I cannot read any of it. It looks like this. http://i36.tinypic.com/52l646.jpg
  43. C

    Using HELIOS Code for Preparing Macroscopic XS in PARCS

    Hello all Has anybody use HELIOS code yet? I need that in order to preparing macroscopic XS to PARCS.
  44. R

    Program to convert text to morse code

    Homework Statement Hi, this is an Hw need to be submitted in 2 hrs ! So, anyone helps I would really apppreaitiate it >> in this problem I am asking the user to enter some text And I wil convert it into Morse Method, I am perfectly fin with that, But the code DOES NOT TYPE out...
  45. E

    Mathematica Troubleshooting Mathematica Code Warnings

    Hello, I have the following Mathematica code warnings: NIntegrate::slwcon: Numerical integration converging too slowly; \ suspect one of the following: singularity, value of the integration \ is 0, highly oscillatory integrand, or WorkingPrecision too small. >> NIntegrate::inumri: The...
  46. G

    Anyone enjoy code breaking puzzles?

    If so, I've got a challenge.
  47. M

    How Can I Devise a Code for Digits 0-9 with a Hamming Distance of 2?

    *Devise a code for the digits 0 to 9 whose Hamming distance is 2.* My efforts to answer this problem are kind of hard to explain, but I'll try. First I wrote out the digits 0 to 9 in binary. Then I tried to find a number that was only 2 numbers different from each one (get 2 ones when XOR...
  48. A

    What are the users of gray code?

    what are the users of gray code? (prctical aplications)
  49. R

    Need help verilog code error

    Need urgent help ...verilog code error Hello , I am new to verilog ...can someone help me urgent .. I have a task for 8 bit register where in i have to model hierarchial modeling ... here are my modules ... correct me please Someone please patietnly go through all modules and let me know...
  50. J

    Understanding the Colon (":") in jQuery Code

    I've looked all over the web, and even downloaded a http://www.pdf-search-engine.com/jquery-pdf.html" (looks very useful), but I have a very simple question. What does the colon ":" mean from the following three segment of code- (1.) SplitID : function() { return...
Back
Top