Cranes Varsity Blog

As soon as you open MATLAB you will get few windows on your screen, some of them are

  1. Command window
  2. Editor Window
  3. Command History
  4. Current folder
  5. Workspace
  6. Help window
  7. Figure Window

Having a brief idea about these windows will give a clear knowledge on how to interact with MATLAB, like, writing programs, designing GUIs, Modelling designs etc..,

Command window is the place where one or multiple commands can be executed one by one, and also the place where all the text and numerical related results will get displayed.

Editor window is used to write/edit scripts and save them.

Command History will store all executed commands from the time of your installation of MATLAB till you uninstall it.

Current folder will have all the files and folders in your current directory, and if you create any new file it will be saved in this folder only(unless mentioned).

Work space will have all the variables you are working now, work space will keep them temporarily maximum for one active session unless saved in .mat files.

Help window provides all the documentation required for each and every command and function available in MATLAB.

Graphical / Image related results will get displayed in a figure window.

 

What is RFID?

Radio frequency identification, or RFID, is a generic term for technologies that use radio waves to automatically identify people or objects. There are several methods of identification, but the most common is to store a serial number that identifies a person or object, and perhaps other information, on a microchip that is attached to an antenna (the chip and the antenna together are called an RFID transponder or an RFID tag). The antenna enables the chip to transmit the identification information to a reader. The reader converts the radio waves reflected back from the RFID tag into digital information that can then be passed on to computers that can make use of it.

How does an RFID system work?

An RFID system consists of a tag, which is made up of a microchip with an antenna, and an interrogator or reader with an antenna. The reader sends out electromagnetic waves. The tag antenna is tuned to receive these waves. A passive RFID tag draws power from field created by the reader and uses it to power the microchip’s circuits. The chip then modulates the waves that the tag sends back to the reader and the reader converts the new waves into digital data.

Are there any health risks associated with RFID and radio waves?

RFID uses the low-end of the electromagnetic spectrum. The waves coming from readers are no more dangerous than the waves coming to your car radio.

Why is RFID better than using bar codes?

RFID is not necessarily "better" than bar codes. The two are different technologies and have different applications, which sometimes overlap. The big difference between the two is bar codes are line-of-sight technology. That is, a scanner has to "see" the bar code to read it, which means people usually have to orient the bar code towards a scanner for it to be read. Radio frequency identification, by contrast, doesn’t require line of sight. RFID tags can be read as long as they are within range of a reader. Bar codes have other shortcomings as well. If a label is ripped, soiled or falls off, there is no way to scan the item. And standard bar codes identify only the manufacturer and product, not the unique item. The bar code on one milk carton is the same as every other, making it impossible to identify which one might pass its expiration date first.

Will RFID replace bar codes?

Probably not, Bar codes are inexpensive and effective for certain tasks. It is likely that RFID and bar codes will coexist for many years.

Is RFID new?

RFID is a proven technology that's been around since at least the 1970s. Up to now, it's been too expensive and too limited to be practical for many commercial applications. But if tags can be made cheaply enough, they can solve many of the problems associated with bar codes. Radio waves travel through most non-metallic materials, so they can be embedded in packaging or encased in protective plastic for weather-proofing and greater durability. And tags have microchips that can store a unique serial number for every product manufactured around the world.

If RFID has been around so long and is so great, why aren’t all companies using it?

Many companies have invested in RFID systems to get the advantages they offer. These investments are usually made in closed-loop systems—that is, when a company is tracking goods that never leave its own control. That’s because all existing RFID systems use proprietary technology, which means that if company A puts an RFID tag on a product, it can’t be read by Company B unless they both use the same RFID system from the same vendor. But most companies don’t have closed-loop systems, and many of the benefits of tracking items come from tracking them as they move from one company to another and even one country to another.

Constant Pointers:

A constant pointer is a pointer that cannot change the address its holding.

In other words, we can say that once a constant pointer points to a variable then it cannot point to any other variable.

Declaration of constant pointer:

<type of pointer> * const <name of pointer>

An example:

                int * const ptr;

An example program:

#include<stdio.h>

int main()

{

    int n1 = 0, n2 = 0;

    int *const ptr = &n1;

    *ptr = 100;//valid

    ptr = &n2;//Invalid

    printf("%d\n", *ptr);

}

In the above example:

We declared two variables n1 and n2 and constant pointer ‘ptr’ was declared and made to point n1. Next, ptr is made to point n2,   then print the value at ptr, but as per the constant pointer the pointer pointing an address cannot be change, so we will get the error mentioned below

“ error: assignment of read-only variable ‘ptr’

           ptr = &n2; ”

but we can change the value at the pointer.

Pointer to Constant:

A pointer to a constant is a pointer that cannot change the value of the address its holding through the pointer.

Declaration of pointer to a constant:

<type of pointer> const * <name of pointer>

                                    or

const <type of pointer>* <name of pointer>

An example:

                int const*ptr;

                                or

                const int *ptr;

An example program:

#include<stdio.h>

int main()

{

    int n1 = 0, n2 = 0;

    const int *ptr = &n1;

    *ptr = 100;//Invalid

    printf("%d\n", *ptr);//Invalid

    ptr = &n2;//valid

    printf("%d\n", *ptr);

}

In the above example:

                We declared two variables n1 and n2 and a pointer to constant ‘ptr’ was declared and made to point n1. Next, ptr is made to dereference, then print the value at ptr, but as per the pointer we cannot dereference, so we got the error mentioned below

  error: assignment of read-only location ‘*ptr’

     *ptr = 100;//Invalid

But we can change the address of the pointer.

Both pointer to constant and constant pointer:

                Both pointer to constant and constant pointer is a pointer that cannot change the address its holding and cannot dereference the value also.

Declaration of constant pointer:

const <type of pointer> * const <name of pointer>

An example:

                const int * const ptr;

An example program:

#include<stdio.h>

int main()

{

    int n1 = 20, n2 = 10;

    const int *const ptr = &n1;

    printf("%d\n", *ptr);//20

    *ptr = 100;//Invalid

    ptr = &n2;//Invalid

 

}

In the above example:

    We declared two variables n1 and n2 , here pointer to constant and constant pointer ‘ptr’ was declared and made to point n1. Next, ptr is made to point n2,   then print the value at ptr, and change the address and dereference the value, both are violating the rules, so we will get the error mentioned below

 “ error: assignment of read-only location ‘*ptr’

     *ptr = 100;//Invalid

          ^

 error: assignment of read-only variable ‘ptr’

     ptr = &n2;//Invalid ”

 

Dynamic Memory Allocation is defined as a process where the size of a data structure can be modified during the run time.

There are certain predefined functions which can implement the above condition.There are 4 library functions provided by C all of which are defined under <stdlib.h> header file to facilitate dynamic memory allocation in C programming.

They are:

  1. malloc()
  2. calloc()
  3. free()
  4. realloc()

malloc()

“malloc” or “memory allocation” method is used to allocate a single large block of memory baes on the specified size. The return type of malloc is of type void pointer which can be typecast-ed to any form.It initializes each block with a default value therefore some garbage value.

Syntax:

int *ptr = (cast-type*) malloc(byte-size)

For Example:  int *ptr = (int*) malloc(100 * sizeof(int));

Since the size of int is 4 bytes, this statement will allocate 400 bytes of memory. And, the pointer ptr holds the address of the first byte in the allocated memory.

calloc()

“calloc” or “contiguous allocation” method is used to allocate specified number of blocks of memory baes on the specified type. It initializes each block with a default value ‘0’.

Syntax:

int *ptr = (cast-type*)calloc(n, element-size);

For Example: int *ptr = (float*) calloc(25, sizeof(float));

This statement allocates contiguous space in memory for 25 elements each with the size of float.

free()

“free” method is used to de-allocate the memory or free the memory which was occupied by using the functions malloc() and calloc(),as they do not de-allocated on their own. Hence the free() method is used, whenever the dynamic memory allocation takes place. It helps to reduce wastage of memory by freeing it.

Syntax:

free(ptr);

realloc()

“realloc” or “re-allocation” method is used to dynamically modify the memory allocation of a previously allocated memory. The memory previously allocated with the help of malloc or calloc is insufficient, realloc can be used to dynamically re-allocate memory.

Syntax:

int*ptr = realloc(ptr, newSize);

where ptr is reallocated with new size 'newSize'

Advanced driver assistance systems require higher accuracy at similar, or in some cases larger, air gap distances between the sensor and the sensed target. Giant magneto-resistance (GMR) is a strong candidate to meet these enhanced requirements. Front-biased magnetic encoder rings are the most common target type in today’s light vehicle applications and the most common implementation for GMR. The GMR replaces the Hall effect as the sensing transducer. In principle, GMR and Hall are both magnetic sensors, but the two differ in fundamental operation and capability.

The GMR resistors are connected in a Wheatstone bridge with half the elements positioned under one magnetic condition, the other half under another.

Automotive speed sensing applications such as ABS may use a ring of magnetic material with alternating north and south magnetization. The GMR sensor may be placed under this material such that the plane of the die is horizontal.The spacing between the four Wheatstone bridge-connected GMR resistor elements creates a differential magnetic field sensed by these sets of elements based on where the ring magnet is in its rotational cycle.

The fundamental principle of the GMR effect is based on electron spins. In a magneto-resistor, electron scattering rates rise or fall as a function of the interaction of the spin state of the electrons and the magnetic orientation of the medium where the electrons are traveling. Electron scattering increases the mean free path of the electron flow, effectively altering the resistance of the medium. Simply put, the GMR transducer’s resistance changes in the presence of a magnetic field.

Earlier generations of MR technology limited sensing angle, linear range, and sensitivity. These limitations have been overcome in Allegro’s state-of-the-art patented GMR technology, providing greater range, and higher sensitivity. The sensing orientation allows the GMR sensor to be a drop-in replacement for Hall effect sensors.

 

The fundamental principle of the GMR effect is based on electron spins. In a magneto-resistor, electron scattering rates rise or fall as a function of the interaction of the spin state of the electrons and the magnetic orientation of the medium where the electrons are traveling. Electron scattering increases the mean free path of the electron flow, so the GMR transducer’s resistance changes in the presence of a magnetic field.

Historically, the GMR was oriented 90° out of phase from the Hall effect sensor making it difficult to swap the technologies. Another issue seen in earlier MR designs is that of discontinuities in the signal at close air gaps. The signal perturbation directly correlates to higher edge jitter, reducing the wheel speed sensor’s output accuracy. Nearly a decade has been spent overcoming the signal discontinuities in wheel speed sensors now available, such as Allegro’s A19250 and A19350 GMR wheel speed sensors. In addition to low jitter, these sensors offer large operating air gaps which extend far beyond the capability of Hall transducers.

Like Hall effect technology, GMR is monolithically integrated onto a single silicon substrate with signal conditioning circuitry. However, the resulting GMR signal is magnitudes higher than a Hall signal with much greater signal-to-noise and one-tenth the jitter. These qualities let GMR sensors sense objects at much bigger air gaps.

mixpanel.track("Video play");