What is Code: Definition and 958 Discussions

In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication channel or storage in a storage medium. An early example is an invention of language, which enabled a person, through speech, to communicate what they thought, saw, heard, or felt to others. But speech limits the range of communication to the distance a voice can carry and limits the audience to those present when the speech is uttered. The invention of writing, which converted spoken language into visual symbols, extended the range of communication across space and time.
The process of encoding converts information from a source into symbols for communication or storage. Decoding is the reverse process, converting code symbols back into a form that the recipient understands, such as English or/and Spanish.
One reason for coding is to enable communication in places where ordinary plain language, spoken or written, is difficult or impossible. For example, semaphore, where the configuration of flags held by a signaler or the arms of a semaphore tower encodes parts of the message, typically individual letters, and numbers. Another person standing a great distance away can interpret the flags and reproduce the words sent.

View More On Wikipedia.org
  1. N

    MATLAB code to Geometric Random Variable

    Homework Statement Generate Geometric RV with Porbabilty of succcess 0.1 using only rand() Homework Equations rand() geometric rv P=(1-p)^(k-1) * p where p=0.1, k is number of trial in which we get 1st success The Attempt at a Solution rand(n)
  2. N

    MATLAB code to Generate Uniform Random Variable

    Homework Statement Generate 1,00,000 triplets(sets of three) of Uniform random variables on [0,1]. Y be max of each triple and Z be min of each triple. Derive the densities for these RV from theory and compare histograms of Y and Z with densities found in theory. Homework Equations...
  3. D

    LaTeX How to post this Latex code on forum?

    Hello! I just finished typing up my first Latex document for a proof I worked on. Now, I'm having trouble posting it on these forums. Here is the source code... \begin{document} $f : \mathbb{R} \Rightarrow \mathbb{R}$ is odd $\;\Longleftrightarrow \;f(-x) = -f(x) \;\forall x$. Show that...
  4. A

    MATLAB [matlab] something wrong with my code

    Hi all I'm new to matlab/scilab. I want to draw a 3D surface using z = cos(x+y)*cos(3x-y)+cos(x-y)*sin(x+3y)+5e^(x2+y2)/8 I typed "Z=cos(x+y)*cos(3*x-y)+cos(x-y)*sin(x+3*y)+5*exp(-(x.^2+y.^2)/8);" into matlab, but is says "Inconsistent multiplication". I would appreciate anyone who...
  5. A

    Scilab Help: Create 3D Surface Code | Due Tuesday

    Hi all I'm new to scilab. I was given an assignment to use scilab to draw a 3D surface. It needs to be creative and clearly noted what the codes mean. I'm totally freaking out with my assignment because it is due Tuesday next week. I would apprecriate anyone who could help me. Thanks for...
  6. N

    MATLAB code to Generate Raleigh Random Variable

    What is the Matlab code for generating 100,000 Raleigh Random Variable with sigma^2=2 using rand command only. Generate histogram and normalize it by dividing 1,00,000 times the bin width
  7. R

    MATLAB Analyzing Falling Object w/ Linear Friction: Troubleshooting Code

    It's an object that's falling from rest. The equation takes into account linear friction. in any case, this is is my code or program of whatever it is called: m=80;%Mass of ignorance g=9.8;%Gravity beta=1.6*10^-4;%Given coefficient for air at STP D=.4;%Diameter of Palin, assuming she's a...
  8. E

    MATLAB Need Urgent Help:Matlab code for Transmission coefficient for a Pc

    Hi, I have written MATLAB code for Transmission coeficient for a one-dimensional photonic crystal,but i have problems with it.it does not result the right answer!:confused: could anyone help me about this? i use Transfer matrix method: An example: an ENG-DPS structure: %Transmission...
  9. J

    Fortran Fortran Code for Calculating Second-Order Derivative | Get Help Now!

    I'm looking for a fortran code to calculate second-order derivative from a dataset. Please help me!
  10. Orion1

    LaTeX Practice test latex source code

    Does this forum have a source code 'sandbox' to practice test latex source code for publishing on Physics Forums? I remember a sandbox a long time ago when latex was first introduced on Physics Forums, was it removed?
  11. M

    Writing a code in matlab for n variables.

    Hi, I am very new to matlab, this is actually the first time I am using it. I have to write a code for finding averages, right now I have "function av=average(x1,x2,x3,x4,x5) % average(x1,x2,x3,x4,x5) returns the average of (x1,x2,x3,x4,x5) av=(x1+x2+x3+x4+x5)/5; return;" This works just fine...
  12. G

    Matlab, code to eval Jacobian Matrix numerically

    Homework Statement The question is in 5 parts all mainly to do with Newton's Method, I've done parts a,b,d and e, but am struggling with the understanding of part c. They have given us the code but unsure as to how to modify my own code to suit the question. Another problem is I don't...
  13. T

    MATLAB Matlab Help -- code to randomly select a file and a sentence in that file

    clc for ii=1:1:3 % start looping rand_id= rand(1,1) *3; % Randomly generte a number between 1 to 3.if (rand_id<1) rand_id=1; % 0 is ommitted. else rand_id=floor(rand_id); end % rand_id will be used to open a previously saved file randomly. if (rand_id==1)...
  14. R

    Modifying Tornado Vortex Lattice Code for Velocity Output

    I was wondering if anyone has any experience with the vortex lattice code Tornado. I would like to modify the source code of Tornado so that it outputs velocity vectors instead of the pressure distribution. I am assuming this is possible because for the vortex lattice method to work the...
  15. J

    Seeking Basic Fluid Solver Template Code

    Hi guys, I am new to this forum and I don't know if i have reached the right place. I have been searching for a basic starter fluid solver (template code kind of stuff) for a jump start in testing out some of the fluid mechanics and algorithms to simulate fluid dynamics. I don't want to be...
  16. L

    Matlab Code Help for x[n]=x(n2Ts)

    Homework Statement x(t)=4sin(0.5t).3u(t) x[n]=x(n2Ts) The 1st equation, x(t)=4sin(0.5t).2u(t) Code : >> A=2; >> wo=0.5; >> t=5:0.25:50; >> x=A*sin(wo*t).3*(t>=0); >> plot(t,x), grid on >> xlabel('t (s)'); ylabel('Amplitude(unit)') But the second one,x[n]=x(n2Ts), I don't know...
  17. P

    How Challenging Is It to Create a Non-Symbolic MATLAB Laplace Transform Solver?

    Hi all How hard is it to write a symbolic laplace solver ? (I am aware that there are many available out there, but I wanted to write one in MATLAB which doesn't use symbolic toolbox). Where can I start to get a good reference for the code ? Thank you Prabhakar
  18. W

    What type of this source code?

    Hi! May I know what type of this source code it is?It looks like assembly code, but I'm not sure. LIST p=16f648a include "P16f648a.inc" __config h'3f18' PC equ h'02' cblock h'20' endc org h'0000'...
  19. A

    MATLAB Help Needed: MATLAB Code for Semiconductor Laser Rate Equation

    Can anyone help me by giving MATLAB code to simulate semiconductor laser rate equation by finite difference methord. i wrote a code but that was not working. so i need it badly. please help me.
  20. J

    Code Requirements for finger-safe Conductor Rail

    Code Requirements for "finger-safe" Conductor Rail I'm planning to install conductor rails about 7ft above the floor in an astronomical observatory. The rails are IP2 "finger safe" rated. Where should I look to determine if this is sufficient enough for conductor rails which will be within...
  21. M

    Troubleshooting Code: Counting A Wins Over B

    can someone tell me what is wrong with my code? i am trying to make a code that has 1000000 randomly choosing A or B 1000 times. if A is bigger than B, i want to increment the variable called 'aWins'... when i try to get it to print the screen is blank. i left out the int main and #include parts...
  22. T

    Java Can someone look at this Java code for me?

    im starting a project from an Ebook that seems to be missing a line or two or something. Can someone suggest what should be here? I added the ending parsing since it was one of the more obvious missing things. import com.sun.j3d.loaders.*; import...
  23. P

    How Does Simple Encryption Work in Java Programming?

    Hello, My professor wants us to code a program that encrypts a massage and decrypt it , I know that to encrypt something you need a message and a key, and you assign a number to each letter or the message, and you do the same with the key, and then you add the two numbers together to get...
  24. A

    Where can I find source code for scientific programs?

    :rolleyes: ... not sure if this is the right place to post this. Hi, I'm looking for something like GSL but with programs instead of routines. For example, there is a method that was developed in the 80's for solving the time-dependent Schrödinger Equation (M. D. Feit, J. A. Fleck Jr. and...
  25. Z

    Why does the function file_object.readlines() return code and not text?

    Okay, I just began a bit of a python phase, and I want some help. You'll probably be hearing from me quite a bit in the next few weeks. Anyway, my question is about I/O functions. Specifically when it comes to opening and closing text documents. I have successfully opened a file (which I...
  26. C

    How to Calculate C Parameter in FMn Card for MCNP Code

    Hi there I have a question about FMn card in mcnp code. there is a parameter (is named C) in front of FMn card, I can not understand to calculate the value of that parameter. please help me. thanks alot.
  27. M

    Calculating Hypotenuse with C++ Code

    i am trying to write a code that calculates the hypotenuse of a triangle... when i try to run it, i get a run time error. I'm not exactly sure what the problem is. #include <iostream> #include <cmath> using namespace std; void hypotenuse(double side1, double side2...
  28. M

    MATLAB Code help Heat transfer

    Hi so i have a heat transfer project to determine the material (aka the thermal conductivity) and length of a 2d wall. It has to have between -1 and 1 net rate of heat loss from the southern side and above 145 rate of heat transfer from the eastern side. The wall is 20 cm high na the boundry...
  29. B

    PHP WEBSITE HIJACKED - Php code infected - HELP?

    WEBSITE HIJACKED - Php code infected! - HELP!? Hey All, I've got a major *$%#@ problem. I'm freaking out here. Check this out. On my website, I have a way to allow visitors... to become distributors and sell my product as well. When they become a distributor, it creates a subdomain for...
  30. F

    Optimization of C code: smoothing an image.

    Homework Statement I need to optimize this given code: /* A struct used to compute averaged pixel value */ typedef struct { int red; int green; int blue; int num; } pixel_sum; /* Compute min and max of two integers, respectively */ static int min(int a, int b) { return (a < b ...
  31. S

    Need help forgot my alarm code.

    Hi Guys sorry to be a pain We had a power cut in the area, and it messed my alarm up i put my code into turn it off but instead reprogrammed it with a new code. the buttons i used were 12349 but can't remember the order i put them in, could someone pm me a list of combinations to try. it is...
  32. H

    C# Can anyone explain what this c# code does or give a C equalivent?

    C# vs c ! Hello every body! can anyone explain what this c# code does or give a C equalivent? public static void Replace(ref byte b, int pos, byte value) { b = (byte) (value == 1 ? b | (1 << pos) : b & ~(1 << pos)); } public static byte...
  33. F

    Optimization of C Code Loop Unrolling

    Homework Statement I need to optimize this given code that rotates an image 90 degrees so it runs at least three times faster: void naive_rotate(int dim, pixel *src, pixel *dst) { int i, j; for (i = 0; i < dim; i++) for (j = 0; j < dim; j++) dst[RIDX(dim-1-j, i, dim)] =...
  34. K

    MATLAB How to Create a Routine in Matlab for Summing Every 10 Steps of a Matrix?

    hello every one. I want to create a routine in matlab Let A be a (40,1) matrix. I want to create a routine that every 10 steps of A will take the sum and place it in a new matrix. ty
  35. M

    Numerical integration - optimisation of code

    Hello I have a function which is very similar in shape to a Gaussian, except it is not a distribution and it is not analytic, so I can at best calculate a single point on the curve at a time. (In general it is a convolution of different distributions but this is not important). I need to find...
  36. 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.
  37. A

    ADSL MATLAB Code: DMT Simulation with RS Encoder

    Homework Statement Well I was just practicing MATLAB by going through different MATLAB codes available online:smile:.I found this DMT simulation.Here is the link http://cnx.org/content/m11721/latest/ Now I decided to add another block in this implementation - The RS encoder(coz...
  38. 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...
  39. 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...
  40. 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...
  41. 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.
  42. 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...
  43. C

    MATLAB Prob with MATLAB code (Planetary motion)

    Hi, I am writing a code for planetary motion using ODE with runge-kutta. Currently it has only two body, however, I could not get the initial values to fit in properly, the bodies will not move in circular orbital motion. They are moving towards each other. at the v=[10 0;-10 0]...
  44. 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>...
  45. 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...
  46. 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 {...
  47. 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...
  48. 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...
  49. 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.
  50. 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...
Back
Top