Errors generated upon publishing a file

When I publish a simple 20 line program (which works correctly), I get the following
Replace row r of matrix A by its sum with m times row p.
Warning: MATLAB was unable to resolve the URL and open it in the browser:
> In web>displayWarningMessage (line 172)
In web (line 114)
The program is not over 172 lines of code up only 20. I have run Matlab online on multiple different machines and get the same error so I believe that there is a configuration error someplace but I don't know how to fix it. Any help would be appreciated.

2 Comments

When you say "publish" do you mean you called the publish function to create an HTML page with the output of the function? Or did you mean something else with the word "publish"?
The references to line 172 and line 114 indicate the lines in the web function included in MATLAB where the warning occurred, not the line in your code.
Can you show us your function and clarify the meaning of "publish" in this case?
Here is what I am doing. Attached is a simple script to find the surface tension in a drop of fluid given the specific gravity and a measured radius. The program is 22 lines long. I am using the publish tab and either the publish icon or the publish as PDF icon. It makes no difference. I get the error shown in the command window which makes no sense to me as the scribe is only 22 lines.

Sign in to comment.

 Accepted Answer

Taylor
Taylor on 21 Oct 2024
Try just running the publish function @Steven Lord mentioned on your file. The error is with displaying the published HTML using the web function, but if you just run publish("CH_16_2_surface_tension_of_drops.m") you should see a folder titled "html" created in your current folder. That folder should contain an HTML file with the same name as your m-file. Then you can double-click that HTML file to open it using MATLAB's HTML broswer, or right-click and select "Open Outside of MATLAB" to view it in your defaul web browser.

4 Comments

Your suggestin works and I can find the published output in the html folder. I still do not understand the error for displaying the results using the web function and why it will not display. At least I can make some progress.
Ok I have a few things to test.
  1. Run stat = web("CH_16_2_surface_tension_of_drops.html") and see if that at least opens the HTML file in your MATLAB HTML browser. I'm anticipating it will.
  2. Run stat = web("CH_16_2_surface_tension_of_drops.html", "-browser") and see if that open the HTML in your default web browser? I'm anticipating this throws the same error you were seeing earlier.
My thought here is that there is an issue between MATLAB and your web browser. The value of stat will give some indication as to the status of your browser connection.
Thanks. I have tried your suggestion and both commands throw an error.
stat=web("CH_16_2_surface_tension_of_drops.html")
Replace row r of matrix A by its sum with m times row p.
Warning: MATLAB was unable to resolve the URL and open it in the browser:
> In web>displayWarningMessage (line 172)
In web (line 114)
stat =
1
stat=web("CH_16_2_surface_tension_of_drops.html", "-browser")
Replace row r of matrix A by its sum with m times row p.
Warning: MATLAB was unable to resolve the URL and open it in the browser:
> In web>displayWarningMessage (line 172)
In web (line 114)
stat =
1
Well I'm quite surprised the first option did not run. Given that, I'm pretty much out of ideas. The last two suggestions I have:
1. Explore this page on web browsers with MATLAB.
OR

Sign in to comment.

More Answers (0)

Categories

Find more on Scripts in Help Center and File Exchange

Asked:

on 17 Oct 2024

Commented:

on 23 Oct 2024

Community Treasure Hunt

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

Start Hunting!