Is there any possibility that a Matlab code which runs perfectly fine in 32bit system gives error in 64 bit system?

I am facing this problem, any suggestions what could be the reason behind these errors or what I do in order to avoid any errors

 Accepted Answer

There is only one reason why some code that works on 32 bit wouldn't work on 64 bit and it is if that code use either some mex function (C or Fortran code compiled for matlab) or, on Windows, some COM/ActiveX compiled code.
In either case you'll have to recompile the code for 64 bit. If you don't have the source code or can't recompile it, you'll have to find some alternative.
Note that if it were the other way round (going 64 bit to 32 bit), another possible reason would be lack of memory.
It would be useful if you'd tell us what error you're getting.

2 Comments

Thanks for your reply. I am getting these errors most of the time..
1st error:
Subscripted assignment dimension mismatch.
Error in zahv15_COMBINED (line 366) p_vectors(collided_user,:) = ones(1,number_rows)/number_rows;
Error in main15_COMBINED (line 423) output{simulation_index} = zahv15_COMBINED(Numb_slots_static, PFA_vector,N,M,theta_vector,P,LEARNING,MC,probability_of_channel_error,OPTIONAL_LEARNING_PARAMETER)
And the 2nd error is
Error using / Matrix dimensions must agree.
Error in zahv15_COMBINED (line 392) gamma = (1-(1/(1.5-log2(PFA_vector(collided_user)))));
Error in main15_COMBINED (line 423) output{simulation_index} = zahv15_COMBINED(Numb_slots_static, PFA_vector,N,M,theta_vector,P,LEARNING,MC,probability_of_channel_error,OPTIONAL_LEARNING_PARAMETER)
I don't get any of these errors when I run it in to my own laptop which is 32 bit, and I think if there are bugs in the code then it should not also run in 32 bit system as well.. And also there are no mex functions in my code..
Use the debugger http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/ to find out what those values are. Try to break up the long expressions into simple variables.
Likely problems are that collided_user and number_rows are not single numbers but are actually arrays/vectors.

Sign in to comment.

More Answers (1)

My guess is this has nothing to do with bitness but more likely an error in your code that is being reached by a different code path. Common causes are shadowed functions and different paths.
Either way, IA is right. Use the debugger, the easiest is:
dbstop if error
This will stop when the error occurs and you can look at exactly what is causing it.

Categories

Find more on MATLAB Coder in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!