Group Abstract Group Abstract

Message Boards Message Boards

0
|
1.6K Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

Fixing old code that doesn't work on V13.3

Posted 1 year ago

I have been given a file from an older mathmatica version and my task is to get it working in mathmatica 13.3. While using the //Echo, I noticed that the code below is not computing the values for the variables, but just passing off a place holder and giving error messages. I am struggling to understand why that is and how to fix it. Any thoughts and suggestions would be apparated.

findDistances[ll_]:=Module[
{bandheap,len=Length[ll],wid=Length[ll[[1]]],hsize,hindex=0,distancetable,statetable,frozen=-1.,far=300.,band=0.,outofbounds=1000.,dist,maxpixval=255.,minpixval=0.,midpixval,heaptable,j1,j2,nbrs,pt,x,y,x1,y1,x2,y2,next,prev,done},

(*Initializations.*)
midpixval=(maxpixval-minpixval)//Echo;
distancetable =Map[If[#>midpixval,maxpixval,minpixval]&,ll,{2}];
statetable=Map[If[#1>1,far,frozen]&,distancetable,{2}]//Echo;
heaptable=Table[0,{len},{wid}];
hsize=len*wid;
bandheap=Table[{0.,0.,0.},{hsize}];

(*Initialize the band by placing all neighbors of frozen cells thereon.*)
Do[
If[statetable[[ii,jj]]=!=frozen,Continue[]];
nbrs={{ii,jj+1},{ii,jj-1},{ii-1,jj},{ii+1,jj}};
POSTED BY: Aidan Vieson

The provided code has syntax errors, there are two [ that do not have a terminating ]. Please provide code that can be copied, pasted in a notebook, and evaluated.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard