<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/most_recent_feed</link>
    <title>MATLAB Central Newsreader Recent Posts</title>
    <description>Most Recent Posts</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mathworks/zAHF" /><feedburner:info uri="mathworks/zahf" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <pubDate>Thu, 09 Feb 2012 04:16:11 -0500</pubDate>
      <title>Declare variable</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/yX99iE9YIjM/316741</link>
      <author>Britt Schuurs</author>
      <description>Hello all,&lt;br&gt;
&lt;br&gt;
I have a problem assigning the correct name to my variables.&lt;br&gt;
&lt;br&gt;
I would like to import variables from Excel, which I organized seperatedly in different sheets. In every sheet cell A1 contains the name of the variable. Now, as I have quite a lot variables which I would like to import in my matlab program, which I want to be dependent of what I have written in A1 in Excel, I would like to make a loop that does the following (suppose I have 10 sheets):&lt;br&gt;
&lt;br&gt;
for i=1:10;&lt;br&gt;
[ndata,txt,raw]=xlsread('Name file',i);&lt;br&gt;
&lt;br&gt;
Give the data in the imported matrix [ndata(:,:)] the name in the cell [txt(1,1)]&lt;br&gt;
&lt;br&gt;
i=i+1;&lt;br&gt;
&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
Could anybody please help me? Would be great, thanks so much in advance!!&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/yX99iE9YIjM" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316741#866218</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 09 Feb 2012 03:58:12 -0500</pubDate>
      <title>Image to test bench</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/iOdKzsIGarY/316740</link>
      <author>Paul </author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I need ton input a 512X512 image as a serial test vector to a test bench and verify in either Matlab or Simulink enviornment. Can anyone tell me how? The Matlab help demonstrates how to link between Matlab and Modelsim but the values in the wave form are forced. I need the image data to be processed and cannot be forced. Please help me in my problem. Thank you in advance.&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/iOdKzsIGarY" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316740#866217</feedburner:origLink></item>
    <item>
      <pubDate>Thu, 09 Feb 2012 00:10:15 -0500</pubDate>
      <title>Re: need to generate a sine wave with diffrent frequencies using matlab</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/QvJEisS26KI/316731</link>
      <author>C Vasco</author>
      <description>"sayantani" wrote in message &amp;lt;jgue5d$8d0$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; My project need to generate a sinewave using matlab which has 1 lakh samples and the frequency changes randomly after every 10,000 samples. the fs and the frequencies can be as per convenience.Is there any function in matlab to generate this. Pls hint me with any example. thank you.&lt;br&gt;
&lt;br&gt;
I would generate the ten segments independently and then concatenate them:&lt;br&gt;
&lt;br&gt;
fs = 44100;      % choose your own&lt;br&gt;
maxFreq = 20000; % choose your own&lt;br&gt;
&lt;br&gt;
t = (0:10000-1)/fs;&lt;br&gt;
wave = [];&lt;br&gt;
&lt;br&gt;
for idx = 1:10&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;freq = maxFreq*rand;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;segment = sin(2 * pi * freq * t);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;wave = [wave segment];&lt;br&gt;
end&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/QvJEisS26KI" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316731#866216</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 23:41:09 -0500</pubDate>
      <title>Re: Delete ## string ## from text file</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/1lc7gMgBWF0/316698</link>
      <author>C Vasco</author>
      <description>"Urban Kova&lt;br&gt;
i" wrote in message &amp;lt;jgstsb$61f$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi, &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I need to import a text file. As I import it I need to delete all the lines that look like (example):&lt;br&gt;
&amp;gt; ## "some random text" ##&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I've imported text using the following code:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; fileID = fopen('text.txt','r','n', 'windows-1250');&lt;br&gt;
&amp;gt; [letters, count] = fread(fileID);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Any suggestions how I should proceed?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thank you very much for your help.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
fread is suited to binary files, is this really a binary file? Is it more like a formatted text file? If so you might want to look at the textscan function, where you can specify a comment pattern. You can pull in all the strings and ignore everything on a line after "##" if you use:&lt;br&gt;
&lt;br&gt;
fileID = fopen('text.txt','r','n', 'windows-1250');&lt;br&gt;
info = textscan(fileID, '%s', 'CommentStyle', '##');&lt;br&gt;
fclose(fileID);&lt;br&gt;
&lt;br&gt;
- C&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/1lc7gMgBWF0" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316698#866215</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 23:28:10 -0500</pubDate>
      <title>Re: Accessing individual elements in a Multi-Dimensional Array</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/obi-Zn7LbKM/316739</link>
      <author>C Vasco</author>
      <description>"Naresh Shah" &amp;lt;nareshshah139@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;jguqit$mko$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
.&lt;br&gt;
&amp;gt; All give the same values. How do I access the first value in that particular matrix. I don't want to use the A/B/C matrices.&lt;br&gt;
&lt;br&gt;
It looks like symbolic matrices don't act like normal numeric matrices with respect to the cat function. Look at the sizes of your variables in the Workspace. CS is a 1x1x4 sym matrix where one would expect a 4x4x4. I also noticed the variable D is reduced to a 1x1 symbol 0 in CS. Also,&lt;br&gt;
&lt;br&gt;
CS = cat(1,A,B,C,D);&lt;br&gt;
&lt;br&gt;
Does not produce a 16x4 sym matrix as one might expect. The result is a 4x1 sym matrix and actually might be a more efficient way to deal with the data.&lt;br&gt;
&lt;br&gt;
To access the desired value I found that it works to assign the result of the indexing operation to another variable first, for example:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; temp = CS(3); temp(1,1)&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
0&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; temp = CS(3); temp(1,:)&lt;br&gt;
&amp;nbsp;&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&lt;br&gt;
[ 0, 1/2 - theta^2/2, -theta/2, 0]&lt;br&gt;
&lt;br&gt;
As for accessing slices that cut across A,B,C, and D, I don't see an easy way to do that.&lt;br&gt;
&lt;br&gt;
- C&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/obi-Zn7LbKM" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316739#866214</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:57:24 -0500</pubDate>
      <title>Re: Finding a small matrix in larger one</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/McE3EnnYVxo/316725</link>
      <author>Bruno Luong</author>
      <description>"camilla belle" &amp;lt;camilla.belle@poczta.wp.pl&amp;gt; wrote in message &amp;lt;jgu4lt$8f4$1@newsfeed1.man.lodz.pl&amp;gt;...&lt;br&gt;
&amp;gt; Hi.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is there any function in matlab that i can use to find a small matrix within&lt;br&gt;
&amp;gt; a larger one, for example A is 10 x 10 and B 100 x 100 , find A in B and&lt;br&gt;
&amp;gt; return indicies of B where they equals A ? &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.mathworks.com/matlabcentral/fileexchange/23998-findsubmat/"&gt;http://www.mathworks.com/matlabcentral/fileexchange/23998-findsubmat/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
I still remember the very same question was asked few years ago, and Matt has brilliantly derived a fast algorithm that later becomes the FEX. He later "improved" it in order to handle NaN, but using a random pick of pivot value; I don't like very much this undeterministic character, but it's still a good code.&lt;br&gt;
&lt;br&gt;
Perhaps his FEX code still has both engines inside it.&lt;br&gt;
&lt;br&gt;
Bruno&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/McE3EnnYVxo" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316725#866213</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:48:13 -0500</pubDate>
      <title>Accessing individual elements in a Multi-Dimensional Array</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/LFDcRYkoYNc/316739</link>
      <author>Naresh Shah</author>
      <description>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;syms t theta chy sy real;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;A = [0 0 0 0; 0 -theta -0.5 0;0 -0.5 0 0;0 0 0 0];&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;B = [0 theta/2 0.5 0; theta/2 0 0 0;0.5 0 0 0;0 0 0 0];&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;C = [0 (1-(theta^2))/2 -(theta/2) 0;(1-(theta^2))/2 0 0 0; -(theta/2) 0 0 0;0 0 0 0]; &lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;D = sym(zeros(4,4));&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CS = cat(3,A,B,C,D);&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Now when I type &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;gt;&amp;gt; CS(:,1,3)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
[               0, 1/2 - theta^2/2, -theta/2, 0]&lt;br&gt;
[ 1/2 - theta^2/2,               0,        0, 0]&lt;br&gt;
[        -theta/2,               0,        0, 0]&lt;br&gt;
[               0,               0,        0, 0]&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;gt;&amp;gt; CS(:,:,3)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
[               0, 1/2 - theta^2/2, -theta/2, 0]&lt;br&gt;
[ 1/2 - theta^2/2,               0,        0, 0]&lt;br&gt;
[        -theta/2,               0,        0, 0]&lt;br&gt;
[               0,               0,        0, 0]&lt;br&gt;
which is supposed to be different from CS(1,1,3) and CS(:,1,3).&lt;br&gt;
&lt;br&gt;
CS(1,1,3)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
[               0, 1/2 - theta^2/2, -theta/2, 0]&lt;br&gt;
[ 1/2 - theta^2/2,               0,        0, 0]&lt;br&gt;
[        -theta/2,               0,        0, 0]&lt;br&gt;
[               0,               0,        0, 0]&lt;br&gt;
All give the same values. How do I access the first value in that particular matrix. I don't want to use the A/B/C matrices.&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/LFDcRYkoYNc" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316739#866212</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:24:22 -0500</pubDate>
      <title>Re: Finding a small matrix in larger one</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/rT71598GK4Y/316725</link>
      <author>dpb</author>
      <description>On 2/8/2012 3:02 PM, camilla belle wrote:&lt;br&gt;
&amp;gt; For unique numbers it will work but for repeated it will show every number&lt;br&gt;
&amp;gt; from B that equals one from A.&lt;br&gt;
...&lt;br&gt;
&lt;br&gt;
That's true...&lt;br&gt;
&lt;br&gt;
You didn't specify the application.&lt;br&gt;
&lt;br&gt;
But, the above was shown to demonstrate one starting point containing &lt;br&gt;
the necessary information--add the logic to the above to test that there &lt;br&gt;
is an area of the size of the smaller within the area that is all TRUE, &lt;br&gt;
essentially by deleting contiguous rows in which all elements are 0 and &lt;br&gt;
see if can end up w/ a sub-array the size of the target which satisfies &lt;br&gt;
all(subarray)==TRUE&lt;br&gt;
&lt;br&gt;
The more a priori knowledge you have regarding the location of such a &lt;br&gt;
subarray within the larger, the more you can streamline the process--if, &lt;br&gt;
for example, you knew there can't be row in the middle of the subarray &lt;br&gt;
if it exists that is not part of that array, then you can use any() and &lt;br&gt;
all() w/ the dimension arguments and set the found rows/columns = [] w/o &lt;br&gt;
additional checking, just using the found indices.  If, otoh, you could &lt;br&gt;
have a row (say) that is all false in the middle of a pattern and that &lt;br&gt;
eliminating that row would create a false subarray, then you would need &lt;br&gt;
to only eliminate rows/columns that are not inside a potential area, &lt;br&gt;
much like Roger's solution.&lt;br&gt;
&lt;br&gt;
--&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/rT71598GK4Y" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316725#866211</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:24:12 -0500</pubDate>
      <title>help with optimization</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/hZ9S-tLZWz0/316738</link>
      <author>Akshay </author>
      <description>I am currently using fminlbfgs to determine the paramters in a bspline registration. I am trying to make sure the deformation is diffemorphic by constraining the maximum deformation. is it possible to return function values through the output function?&lt;br&gt;
&lt;br&gt;
For ex, if the current iteration has a function value &amp;gt; threshold, i need to return inf so that the iteration goes back one step.&lt;br&gt;
&lt;br&gt;
Please help me regarding this.&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/hZ9S-tLZWz0" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316738#866210</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:24:04 -0500</pubDate>
      <title>compiling 64 bit dll</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/uaMCoeUAqK0/316737</link>
      <author>HASM</author>
      <description>&lt;br&gt;
We built a pair of 32 bit DLLs Matlab (need to double check the version) on&lt;br&gt;
Windows XP with Visual Studio 2008 that we call from Labview 7 (32 bit).&lt;br&gt;
Everything works fine.&lt;br&gt;
&lt;br&gt;
We also built the same DLLs with Matlab R2011a as 64 bit DLLs on a Windows&lt;br&gt;
7 machine that we try to call from Labview 2011 (64 bit).  Code crashes&lt;br&gt;
with access violation, seems at the first call to an external function,&lt;br&gt;
i.e. not in the same .m file.&lt;br&gt;
&lt;br&gt;
Not sure how to investigate this.&lt;br&gt;
&lt;br&gt;
-- HASM&lt;br&gt;
&amp;nbsp;&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/uaMCoeUAqK0" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316737#866209</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:08:24 -0500</pubDate>
      <title>Re: Image compression using Daubechies db4</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/_kQC_nZjNm8/316339</link>
      <author>sampath </author>
      <description>"sampath" wrote in message &amp;lt;jfuahi$a6s$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; In image compression using we have to perform convolution using the low pass filter coefficients and the image matrix. Even though i know filter coefficients I haven't got any idea how to form the matrix using those coefficients. i.e. From where to start the second row and also the remaining rows. Can someone help me ASAP&lt;br&gt;
&lt;br&gt;
Hi,&lt;br&gt;
I'm working on a project which is to compress an image using Daubechies Db4 wavelet. I shouldn't use the "conv2" and instead I have to write the iteration equation to find the Approximation, Horizontal, Vertical and Diagonal coefficients. The process is to convolute an image and downsample it horizontally and again convolute it for the second time and again downsample it vertically. I took an image of 64x64. when i convoluted horizontally (horizontal axis) for the first time, the image became 71x64 and after downsampling it became 35x64 which removed all the odd number columns. When i convoluted vertically (vertical axis) i.e. second convolution the image became 35x71 and after downsampling along the vertical axis gave an image of 35x35 theoritically. I tried to form an iteration equation with the obtained pixels of 35x35 approximation coefficient. But i'm getting an error "??? &lt;br&gt;
Subscripted assignment dimension mismatch". Can someone please help me out? &lt;br&gt;
Here is my code&lt;br&gt;
%Image compression using Daubechies Db4 wavelet&lt;br&gt;
clc; clear; close all;&lt;br&gt;
r=imread('dsc03.jpg');&lt;br&gt;
r=rgb2gray(r);&lt;br&gt;
s=single(r);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
h0=[-0.0106 -0.0329 0.0308 0.1870 -0.0280 -0.6309 0.7148 -0.2304];&lt;br&gt;
h1=[-0.2304 0.7149 0.6309 -0.0280 -0.1870 0.0308 0.0329 -0.0106];&lt;br&gt;
% disp('2D-DWT Decomposition')&lt;br&gt;
%[A,H,V,D]=dwt2(s,'dbaux');&lt;br&gt;
%[A,H,V,D]=dwt2(s,h0,h1);&lt;br&gt;
&lt;br&gt;
%[m,n]=size(r);   %[m=row n=column]&lt;br&gt;
m=70;&lt;br&gt;
n=70;&lt;br&gt;
for i=1:m&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1:n&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of A using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ad(i,j)=[(s(2*i+6,j)*h0(8)+s(2*i+6,j+1)*h0(7)+s(2*i+6,j+2)*h0(6)+s(2*i+6,j+3)*h0(5)+s(2*i+6,j+4)*h0(4)+s(2*i+6,j+5)*h0(3)+s(2*i+6,j+6)*h0(2)+s(2*i+6,j+7)*h0(1))*h0(1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+5,j)*h0(8)+s(2*i+5,j+1)*h0(7)+s(2*i+5,j+2)*h0(6)+s(2*i+5,j+3)*h0(5)+s(2*i+5,j+4)*h0(4)+s(2*i+5,j+5)*h0(3)+s(2*i+5,j+6)*h0(2)+s(2*i+5,j+7)*h0(1))*h0(2)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+4,j)*h0(8)+s(2*i+4,j+1)*h0(7)+s(2*i+4,j+2)*h0(6)+s(2*i+4,j+3)*h0(5)+s(2*i+4,j+4)*h0(4)+s(2*i+4,j+5)*h0(3)+s(2*i+4,j+6)*h0(2)+s(2*i+4,j+7)*h0(1))*h0(3)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+3,j)*h0(8)+s(2*i+3,j+1)*h0(7)+s(2*i+3,j+2)*h0(6)+s(2*i+3,j+3)*h0(5)+s(2*i+3,j+4)*h0(4)+s(2*i+3,j+5)*h0(3)+s(2*i+3,j+6)*h0(2)+s(2*i+3,j+7)*h0(1))*h0(4)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+2,j)*h0(8)+s(2*i+2,j+1)*h0(7)+s(2*i+2,j+2)*h0(6)+s(2*i+2,j+3)*h0(5)+s(2*i+2,j+4)*h0(4)+s(2*i+2,j+5)*h0(3)+s(2*i+2,j+6)*h0(2)+s(2*i+2,j+7)*h0(1))*h0(5)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+1,j)*h0(8)+s(2*i+1,j+1)*h0(7)+s(2*i+1,j+2)*h0(6)+s(2*i+1,j+3)*h0(5)+s(2*i+1,j+4)*h0(4)+s(2*i+1,j+5)*h0(3)+s(2*i+1,j+6)*h0(2)+s(2*i+1,j+7)*h0(1))*h0(6)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i,j)*h0(8)+s(2*i,j+1)*h0(7)+s(2*i,j+2)*h0(6)+s(2*i,j+3)*h0(5)+s(2*i,j+4)*h0(4)+s(2*i,j+5)*h0(3)+s(2*i,j+6)*h0(2)+s(2*i,j+7)*h0(1))*h0(7)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i-1,j)*h0(8)+s(2*i-1,j+1)*h0(7)+s(2*i-1,j+2)*h0(6)+s(2*i-1,j+3)*h0(5)+s(2*i-1,j+4)*h0(4)+s(2*i-1,j+5)*h0(3)+s(2*i-1,j+6)*h0(2)+s(2*i-1,j+7)*h0(1))*h0(8)];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
figure&lt;br&gt;
imshow(r)&lt;br&gt;
figure&lt;br&gt;
Atemp=uint8(Ad);&lt;br&gt;
imshow(Atemp)&lt;br&gt;
&lt;br&gt;
It worked with Haar wavelet which only two coefficients. Here is the code for Image compression using Haar wavelet.&lt;br&gt;
&lt;br&gt;
clc; clear; close all;&lt;br&gt;
disp('2D-DWT Image file *Check workspace')&lt;br&gt;
% disp('2D-DWT using dwt function')&lt;br&gt;
% process sample image file&lt;br&gt;
y=imread('mikan.jpg');&lt;br&gt;
y=rgb2gray(y);&lt;br&gt;
x=single(y);        %very important if not x remain in 8bit&lt;br&gt;
&lt;br&gt;
h0=[0.7071 0.7071];&lt;br&gt;
h1=[0.7071 -0.7071];&lt;br&gt;
% disp('2D-DWT Decomposition')&lt;br&gt;
[A,H,V,D]=dwt2(x,h0,h1);&lt;br&gt;
&lt;br&gt;
[m,n]=size(x);   %[m=row n=column]&lt;br&gt;
&lt;br&gt;
for i=1:m/2&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1:n/2&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of A using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ad(i,j)=(x(2*i-1,2*j-1)+x(2*i-1,2*j)+x(2*i,2*j-1)+x(2*i,2*j))*h0(1)*h0(1);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of H using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Hd(i,j)=(x(2*i,2*j-1)+x(2*i,2*j))*h0(1)*h0(1)+(x(2*i-1,2*j-1)+x(2*i-1,2*j))*h0(1)*h1(2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of V using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Vd(i,j)=(x(2*i-1,2*j)+x(2*i,2*j))*h0(1)*h0(1)+(x(2*i-1,2*j-1)+x(2*i,2*j-1))*h0(1)*h1(2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of D using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dd(i,j)=(x(2*i,2*j))*h0(1)*h0(1)+(x(2*i-1,2*j-1))*h1(2)*h1(2)+(x(2*i-1,2*j)+x(2*i,2*j-1))*h0(1)*h1(2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
figure&lt;br&gt;
imshow(y)&lt;br&gt;
figure&lt;br&gt;
Atemp=uint8(Ad);&lt;br&gt;
imshow(Atemp)&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/_kQC_nZjNm8" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316339#866208</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 21:02:57 -0500</pubDate>
      <title>Re: Finding a small matrix in larger one</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/IcenlRLhAZE/316725</link>
      <author>camilla belle</author>
      <description>For unique numbers it will work but for repeated it will show every number &lt;br&gt;
from B that equals one from A.&lt;br&gt;
&lt;br&gt;
Uzytkownik "dpb" &amp;lt;none@non.net&amp;gt; napisal w wiadomosci &lt;br&gt;
news:jgukme$e8k$1@speranza.aioe.org...&lt;br&gt;
&amp;gt; On 2/8/2012 9:34 AM, camilla belle wrote:&lt;br&gt;
&amp;gt;&amp;gt; Hi.&lt;br&gt;
&amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Is there any function in matlab that i can use to find a small matrix &lt;br&gt;
&amp;gt;&amp;gt; within&lt;br&gt;
&amp;gt;&amp;gt; a larger one, for example A is 10 x 10 and B 100 x 100 , find A in B and&lt;br&gt;
&amp;gt;&amp;gt; return indicies of B where they equals A ?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; x=rand(3);&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; y=x(2:3,2:3);&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; ismember(x,y)&lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;      0     0     0&lt;br&gt;
&amp;gt;      0     1     1&lt;br&gt;
&amp;gt;      0     1     1&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt;&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/IcenlRLhAZE" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316725#866207</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 20:56:18 -0500</pubDate>
      <title>Image compression using Daubechies Db4 wavelet</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/0N5JbNI8XE8/316736</link>
      <author>sampath </author>
      <description>Hi,&lt;br&gt;
I'm working on a project which is to compress an image using Daubechies Db4 wavelet. I shouldn't use the "conv2" and instead I have to write the iteration equation to find the Approximation, Horizontal, Vertical and Diagonal coefficients. The process is to convolute an image and downsample it horizontally and again convolute it for the second time and again downsample it vertically. I took an image of 64x64. when i convoluted horizontally (horizontal axis) for the first time, the image became 71x64 and after downsampling it became 35x64 which removed all the odd number columns. When i convoluted vertically (vertical axis) i.e. second convolution the image became 35x71 and after downsampling along the vertical axis gave an image of 35x35 theoritically. I tried to form an iteration equation with the obtained pixels of 35x35 approximation coefficient. But i'm getting an error "??? &lt;br&gt;
Subscripted assignment dimension mismatch". Can someone please help me out? &lt;br&gt;
Here is my code&lt;br&gt;
%Image compression using Daubechies Db4 wavelet&lt;br&gt;
clc; clear; close all;&lt;br&gt;
r=imread('dsc03.jpg');&lt;br&gt;
r=rgb2gray(r);&lt;br&gt;
s=single(r);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
h0=[-0.0106 -0.0329 0.0308 0.1870 -0.0280 -0.6309 0.7148 -0.2304];&lt;br&gt;
h1=[-0.2304 0.7149 0.6309 -0.0280 -0.1870 0.0308 0.0329 -0.0106];&lt;br&gt;
% disp('2D-DWT Decomposition')&lt;br&gt;
%[A,H,V,D]=dwt2(s,'dbaux');&lt;br&gt;
%[A,H,V,D]=dwt2(s,h0,h1);&lt;br&gt;
&lt;br&gt;
%[m,n]=size(r);   %[m=row n=column]&lt;br&gt;
m=70;&lt;br&gt;
n=70;&lt;br&gt;
for i=1:m&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1:n&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of A using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ad(i,j)=[(s(2*i+6,j)*h0(8)+s(2*i+6,j+1)*h0(7)+s(2*i+6,j+2)*h0(6)+s(2*i+6,j+3)*h0(5)+s(2*i+6,j+4)*h0(4)+s(2*i+6,j+5)*h0(3)+s(2*i+6,j+6)*h0(2)+s(2*i+6,j+7)*h0(1))*h0(1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+5,j)*h0(8)+s(2*i+5,j+1)*h0(7)+s(2*i+5,j+2)*h0(6)+s(2*i+5,j+3)*h0(5)+s(2*i+5,j+4)*h0(4)+s(2*i+5,j+5)*h0(3)+s(2*i+5,j+6)*h0(2)+s(2*i+5,j+7)*h0(1))*h0(2)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+4,j)*h0(8)+s(2*i+4,j+1)*h0(7)+s(2*i+4,j+2)*h0(6)+s(2*i+4,j+3)*h0(5)+s(2*i+4,j+4)*h0(4)+s(2*i+4,j+5)*h0(3)+s(2*i+4,j+6)*h0(2)+s(2*i+4,j+7)*h0(1))*h0(3)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+3,j)*h0(8)+s(2*i+3,j+1)*h0(7)+s(2*i+3,j+2)*h0(6)+s(2*i+3,j+3)*h0(5)+s(2*i+3,j+4)*h0(4)+s(2*i+3,j+5)*h0(3)+s(2*i+3,j+6)*h0(2)+s(2*i+3,j+7)*h0(1))*h0(4)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+2,j)*h0(8)+s(2*i+2,j+1)*h0(7)+s(2*i+2,j+2)*h0(6)+s(2*i+2,j+3)*h0(5)+s(2*i+2,j+4)*h0(4)+s(2*i+2,j+5)*h0(3)+s(2*i+2,j+6)*h0(2)+s(2*i+2,j+7)*h0(1))*h0(5)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i+1,j)*h0(8)+s(2*i+1,j+1)*h0(7)+s(2*i+1,j+2)*h0(6)+s(2*i+1,j+3)*h0(5)+s(2*i+1,j+4)*h0(4)+s(2*i+1,j+5)*h0(3)+s(2*i+1,j+6)*h0(2)+s(2*i+1,j+7)*h0(1))*h0(6)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i,j)*h0(8)+s(2*i,j+1)*h0(7)+s(2*i,j+2)*h0(6)+s(2*i,j+3)*h0(5)+s(2*i,j+4)*h0(4)+s(2*i,j+5)*h0(3)+s(2*i,j+6)*h0(2)+s(2*i,j+7)*h0(1))*h0(7)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;+(s(2*i-1,j)*h0(8)+s(2*i-1,j+1)*h0(7)+s(2*i-1,j+2)*h0(6)+s(2*i-1,j+3)*h0(5)+s(2*i-1,j+4)*h0(4)+s(2*i-1,j+5)*h0(3)+s(2*i-1,j+6)*h0(2)+s(2*i-1,j+7)*h0(1))*h0(8)];&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
figure&lt;br&gt;
imshow(r)&lt;br&gt;
figure&lt;br&gt;
Atemp=uint8(Ad);&lt;br&gt;
imshow(Atemp)&lt;br&gt;
&lt;br&gt;
It worked with Haar wavelet which only two coefficients. Here is the code for Image compression using Haar wavelet.&lt;br&gt;
&lt;br&gt;
clc; clear; close all;&lt;br&gt;
disp('2D-DWT Image file *Check workspace')&lt;br&gt;
% disp('2D-DWT using dwt function')&lt;br&gt;
% process sample image file&lt;br&gt;
y=imread('mikan.jpg');&lt;br&gt;
y=rgb2gray(y);&lt;br&gt;
x=single(y);        %very important if not x remain in 8bit&lt;br&gt;
&lt;br&gt;
h0=[0.7071 0.7071];&lt;br&gt;
h1=[0.7071 -0.7071];&lt;br&gt;
% disp('2D-DWT Decomposition')&lt;br&gt;
[A,H,V,D]=dwt2(x,h0,h1);&lt;br&gt;
&lt;br&gt;
[m,n]=size(x);   %[m=row n=column]&lt;br&gt;
&lt;br&gt;
for i=1:m/2&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j=1:n/2&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of A using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Ad(i,j)=(x(2*i-1,2*j-1)+x(2*i-1,2*j)+x(2*i,2*j-1)+x(2*i,2*j))*h0(1)*h0(1);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of H using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Hd(i,j)=(x(2*i,2*j-1)+x(2*i,2*j))*h0(1)*h0(1)+(x(2*i-1,2*j-1)+x(2*i-1,2*j))*h0(1)*h1(2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of V using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Vd(i,j)=(x(2*i-1,2*j)+x(2*i,2*j))*h0(1)*h0(1)+(x(2*i-1,2*j-1)+x(2*i,2*j-1))*h0(1)*h1(2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;% disp('2D-DWT Decomposition of D using formula')&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dd(i,j)=(x(2*i,2*j))*h0(1)*h0(1)+(x(2*i-1,2*j-1))*h1(2)*h1(2)+(x(2*i-1,2*j)+x(2*i,2*j-1))*h0(1)*h1(2);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
figure&lt;br&gt;
imshow(y)&lt;br&gt;
figure&lt;br&gt;
Atemp=uint8(Ad);&lt;br&gt;
imshow(Atemp)&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/0N5JbNI8XE8" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316736#866206</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 20:50:11 -0500</pubDate>
      <title>Re: Finding a small matrix in larger one</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/eSvmAY7sTI0/316725</link>
      <author>Roger Stafford</author>
      <description>"camilla belle" &amp;lt;camilla.belle@poczta.wp.pl&amp;gt; wrote in message &amp;lt;jgu4lt$8f4$1@newsfeed1.man.lodz.pl&amp;gt;...&lt;br&gt;
&amp;gt; Is there any function in matlab that i can use to find a small matrix within&lt;br&gt;
&amp;gt; a larger one, for example A is 10 x 10 and B 100 x 100 , find A in B and&lt;br&gt;
&amp;gt; return indicies of B where they equals A ? &lt;br&gt;
- - - - - - - - -&lt;br&gt;
[mA,nA] = size(A);&lt;br&gt;
[mB,nB] = size(B);&lt;br&gt;
F = zeros((mB-mA+1)*(nB-nA+1),2);&lt;br&gt;
k = 0;&lt;br&gt;
for p = 1:mB-mA+1&lt;br&gt;
&amp;nbsp;for q = 1:nB-nA+1&lt;br&gt;
&amp;nbsp;&amp;nbsp;if all(all(A==B(p:p+mA-1,q:q+nA-1)))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;k = k + 1;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;F(k,:) = [p,q];&lt;br&gt;
&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
F(k+1:end,:) = [];&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/eSvmAY7sTI0" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316725#866205</feedburner:origLink></item>
    <item>
      <pubDate>Wed, 08 Feb 2012 20:39:13 -0500</pubDate>
      <title>Re: Solving the Quadratic Trignometric Equation</title>
      <link>http://feedproxy.google.com/~r/mathworks/zAHF/~3/4QyhLz_Jovc/316711</link>
      <author>Roger Stafford</author>
      <description>"Zeeshan Shareef" &amp;lt;zeeshan_iiee@yahoo.com&amp;gt; wrote in message &amp;lt;jgtheo$2n0$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a equation:&lt;br&gt;
&amp;gt; a*(sin(theta)^2) + b*sin(2*theta) = c&lt;br&gt;
&amp;gt; How I can solve this equation ? I know all the variable a,b and c. Only 'theta' is unknown to me.&lt;br&gt;
- - - - - - - - -&lt;br&gt;
&amp;nbsp;&amp;nbsp;Here's a method that uses the atan2 function:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;p = 1/2*atan2(2*b,a);&lt;br&gt;
&amp;nbsp;q = 1/2*acos((a-2*c)/sqrt(a^2+4*b^2));&lt;br&gt;
&amp;nbsp;theta1 = q-p; theta2 = -q-p;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;There are actually infinitely many roots in general to your equation, but all differ from theta1 or theta2 by integral multiples of pi.  Note that if the magnitude of a-2*c exceeds that of sqrt(a^2+4*b^2), there can be no solutions.  This is indicated by complex values for q.&lt;br&gt;
&lt;br&gt;
Roger Stafford&lt;img src="http://feeds.feedburner.com/~r/mathworks/zAHF/~4/4QyhLz_Jovc" height="1" width="1"/&gt;</description>
    <feedburner:origLink>http://www.mathworks.com/matlabcentral/newsreader/view_thread/316711#866204</feedburner:origLink></item>
  </channel>
</rss>

