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.
Homework Statement
I have to program a three component decay chain using finite difference approximation. I understand finite difference and have written my code, but I have an error I can not find which is giving me an erroneous answer. The curve is correct, but the magnitude of the...
Hi guys,
I just wrote a simple code for delta function and print it out. Here it is.
program main
implicit none
integer i
real*8 del
real*8,parameter:: ep=1D-2
real*8,parameter:: pi=3.1415926
do i=-10,10,1
write(*,*)...
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)
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...
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...
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...
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...
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
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...
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...
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?
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...
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...
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)...
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...
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...
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
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'...
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.
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...
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...
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...
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...
: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...
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...
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.
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...
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...
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...
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 ...
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...
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...
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)] =...
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
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...
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.
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...
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...
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...
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...
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.
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...
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]...
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>...
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...
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 {...
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...
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...