Ph.D. in theoretical nuclear physics, author of four books and lecturer at the College of Science-University of Baghdad since 2008. Interested with image processing applications in astronomy mainly. I begun using Matab since the year 2000 (I think it was ver.5.), and still there is much to learn about.

Professional Interests: Theoretical Physics

Submitted

dec2any(x,n)

Decimal (base 10) number to any (base 2 to 10) converion function.

5 years ago | 0 downloads |

Submitted

dec2senary(num)

Decimal (base 10) number to senary (base 6) converion function.

5 years ago | 0 downloads |

Answered

Help naming text file according to user input

Just add the extension you like to the variable (fileName), as prompt = 'Please enter the file name: '; fileName = input(...

Help naming text file according to user input

Just add the extension you like to the variable (fileName), as prompt = 'Please enter the file name: '; fileName = input(...

6 years ago | 3

| accepted

Answered

how to find the second order partial derivative of an image?

See older and similar question here: <http://www.mathworks.com/matlabcentral/answers/67893>

how to find the second order partial derivative of an image?

See older and similar question here: <http://www.mathworks.com/matlabcentral/answers/67893>

6 years ago | 0

Answered

Reshape array for 256 by 256 matrix showing 16 by 256

Dear sudipta, I have downloaded your data file, and went like a=load('1372387722318.txt'); y=reshape (a,256,256); ...

Reshape array for 256 by 256 matrix showing 16 by 256

Dear sudipta, I have downloaded your data file, and went like a=load('1372387722318.txt'); y=reshape (a,256,256); ...

6 years ago | 0

| accepted

Answered

Save 512x512 matrix to text file

This code works perfectly. To check it add the following at the very end of the above code: fid = fopen('Mymatrix.txt','r'...

Save 512x512 matrix to text file

This code works perfectly. To check it add the following at the very end of the above code: fid = fopen('Mymatrix.txt','r'...

6 years ago | 0

Answered

solve 2 equation of 2 unknown

Use the code instead: clc clear syms theta3 r1 %sind(theta3) % NOT NEEDED r2=3; r3=3.927; r4=0.335; ...

solve 2 equation of 2 unknown

Use the code instead: clc clear syms theta3 r1 %sind(theta3) % NOT NEEDED r2=3; r3=3.927; r4=0.335; ...

6 years ago | 1

| accepted

Answered

extracting submatrices from cell

Try the same example with: X={1, 'a'; 'b', 3.14}; K1=X(2,:) [K21 K22]=X{2,:} Then use whos to...

extracting submatrices from cell

Try the same example with: X={1, 'a'; 'b', 3.14}; K1=X(2,:) [K21 K22]=X{2,:} Then use whos to...

6 years ago | 0

| accepted

Answered

How to identify boundaries of shapes in an image using the change in color

There are few files in the file-exchange <http://www.mathworks.com/matlabcentral/fileexchange/> so do some search there, you mig...

How to identify boundaries of shapes in an image using the change in color

There are few files in the file-exchange <http://www.mathworks.com/matlabcentral/fileexchange/> so do some search there, you mig...

6 years ago | 0

Answered

error message using polynom

A polynomial P(x) is said to be (badly conditioned) when a small variances of x leads to large errors of P, causing unstable err...

error message using polynom

A polynomial P(x) is said to be (badly conditioned) when a small variances of x leads to large errors of P, causing unstable err...

6 years ago | 0

Answered

Creating a matrix with matrices on the sub and super diagonals

Use the command (diag) for creating a (main) diagonal matrix from a vector A, and the command (spdiags) to create sub- and super...

Creating a matrix with matrices on the sub and super diagonals

Use the command (diag) for creating a (main) diagonal matrix from a vector A, and the command (spdiags) to create sub- and super...

6 years ago | 0

Answered

Picking out a value from a Vector in a Loop iteration

Within your same code: ... plot(Y(:,1),Y(:,2),'o'); z=zeros(1,length(X)); % Add this for i = 1:length(X) f...

Picking out a value from a Vector in a Loop iteration

Within your same code: ... plot(Y(:,1),Y(:,2),'o'); z=zeros(1,length(X)); % Add this for i = 1:length(X) f...

6 years ago | 0

Answered

More help with probability...

Just pay attention to how you use function call inside a program. Either you have two files as stated above, or use one main (ca...

More help with probability...

Just pay attention to how you use function call inside a program. Either you have two files as stated above, or use one main (ca...

6 years ago | 0

| accepted

Answered

how to solve loops conditions ??

#1) Using for loops only: clear k=0; for i=1:6 for j=1:5 k=k+1; A(i,j)=k; end end ...

how to solve loops conditions ??

#1) Using for loops only: clear k=0; for i=1:6 for j=1:5 k=k+1; A(i,j)=k; end end ...

6 years ago | 0

Submitted

Blancmange-Takagi Function

Used to plot the Blancmange-Takagi function of order (w) and range (x).

6 years ago | 1 download |

Answered

Symbolic expressions: abs(x^(1/3)) =?= abs(x)^(1/3)

Some times we get confused between mathematics and programming, it is an often thing. Yet, mathematics means logic, programs try...

Symbolic expressions: abs(x^(1/3)) =?= abs(x)^(1/3)

Some times we get confused between mathematics and programming, it is an often thing. Yet, mathematics means logic, programs try...

6 years ago | 0

Answered

how to write a .dat file in matlab?

The obvious method is to construct a loop to read filenames, inside it, open and read, then accumulate the data content in some ...

how to write a .dat file in matlab?

The obvious method is to construct a loop to read filenames, inside it, open and read, then accumulate the data content in some ...

6 years ago | 0

| accepted

Answered

Reading many files in one loop

Download a function file called folderFiles.m. <http://www.mathworks.com/matlabcentral/fileexchange/40877-folderfiles-m> ...

Reading many files in one loop

Download a function file called folderFiles.m. <http://www.mathworks.com/matlabcentral/fileexchange/40877-folderfiles-m> ...

6 years ago | 0

| accepted

Answered

How to read a text file line by line?

Try selecting one dimension a time for each line, e.g., ... time=fscanf(fID,'%g',[1 1:2:inf]); acce=fscanf(fID,'%g',[...

How to read a text file line by line?

Try selecting one dimension a time for each line, e.g., ... time=fscanf(fID,'%g',[1 1:2:inf]); acce=fscanf(fID,'%g',[...

6 years ago | 0

Answered

Obtaning a matrix with the right indexes

Try this out to see if it solves the issue: clear clc N=20; %for example H=sym(zeros(N,4)); B=1:N; ...

Obtaning a matrix with the right indexes

Try this out to see if it solves the issue: clear clc N=20; %for example H=sym(zeros(N,4)); B=1:N; ...

6 years ago | 0

Answered

How to create a nested for loop to create a mesh plot

I'm not sure what are your conditions (in the if statements), but you used (y1) as a matrix index which cannot be made unless (y...

How to create a nested for loop to create a mesh plot

I'm not sure what are your conditions (in the if statements), but you used (y1) as a matrix index which cannot be made unless (y...

6 years ago | 0

Answered

Hi all, could you please help me to solve this equation either numerically of symbolically.

If all variables other than (y) are known, then let's write some notes here: 1) Try to first define the variables, namely: kw...

Hi all, could you please help me to solve this equation either numerically of symbolically.

If all variables other than (y) are known, then let's write some notes here: 1) Try to first define the variables, namely: kw...

6 years ago | 0

Answered

Issue with writing multiple variable to excel sheet

It is not practical to write a single line in an excel file, for a large amount of data or inside a long-time running loop. If y...

Issue with writing multiple variable to excel sheet

It is not practical to write a single line in an excel file, for a large amount of data or inside a long-time running loop. If y...

6 years ago | 1

Answered

while loop question number 2

In such a case, using a while loop cannot do the job, but an if statement can. So, I think this is what are you looking for (con...

while loop question number 2

In such a case, using a while loop cannot do the job, but an if statement can. So, I think this is what are you looking for (con...

6 years ago | 0

Answered

How to plot a complicated function

It is the same code you wrote, only add loops over c and tau, and use the function (ezplot) to plot a function handle. And DO NO...

How to plot a complicated function

It is the same code you wrote, only add loops over c and tau, and use the function (ezplot) to plot a function handle. And DO NO...

6 years ago | 0

| accepted

Answered

how to code probability in general??

First what is magic(2)? I thought the smallest magic matrix comes (3-by-3) since Magic (2) doesn't satisfy the condition (sum ea...

how to code probability in general??

First what is magic(2)? I thought the smallest magic matrix comes (3-by-3) since Magic (2) doesn't satisfy the condition (sum ea...

6 years ago | 0

| accepted

Answered

Lighting the Solar System - Omnidirectional light source (Sun)

I don't know really if Matlab is used for such tasks, but haven't you tried Simulink for easier handling of the problem? Such gr...

Lighting the Solar System - Omnidirectional light source (Sun)

I don't know really if Matlab is used for such tasks, but haven't you tried Simulink for easier handling of the problem? Such gr...

6 years ago | 0

Answered

while loop in data file for trapz?

Apparently, the variable (Num) is not (1). That's why the (while loop) returns nothing. I've tried the lines you posted and it w...

while loop in data file for trapz?

Apparently, the variable (Num) is not (1). That's why the (while loop) returns nothing. I've tried the lines you posted and it w...

6 years ago | 0