To get spaces in the strings to work in matlab or octave, use
t1={‘test test’}
Result is
t1 =
{
[1,1] = test test
}
t2=strcat({‘test test ‘},{‘blah blah’})
Result is
t2 =
{
[1,1] = test …

In Octave or Matlab, some times one needs to eliminate certain elements in an array.
For example, if
a=[10,20,30,40,50,60];
and suppose I want to create a matrix “b” such that it has …

The aim of this post is to share my experience in incorporating dielectric function of metals such as gold and silver into MEEP (a free finite difference time domain package) …

To insert a title to the colorbar in matlab. Use the following code(Source):
load mandrill % Loads a data for the example
image(X) % Plots an image for the example
t=colorbar;% Inserts a …

The electric field from an oscillating dipole is given by:, where is the position vector, is the frequency of dipole oscillation, is the dipole moment. The two …

In matlab, sometimes I prefer to plot a image for mesh data instead of surf and use view(2) (view(2) gives the top view of the surface plot). However,
imagesc(x,y,z)
shading ‘interp’
does not …