Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8287055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:56:01+00:00 2026-06-08T11:56:01+00:00

I want to save an image from a designated axes. I keep getting You

  • 0

I want to save an image from a designated axes. I keep getting You may not have permission to write error. Here is my code for the save as push button:

axes(handles.axes3);
[FileName, PathName] = uiputfile('*bmp', 'Save As');
Name = fullfile(FileName, PathName);
imwrite(handles.TReg, Name, 'bmp');

Also, handles.TReg is a transformed image defined on another function.

I cannot seem to find my error here, any thoughts would be appreciated.

Edit
If I use the code:

axes(handles.axes3);
[FileName, PathName] = uiputfile('*bmp', 'Save As');
Name = fullfile(FileName, PathName);
imwrite(handles.TReg, 'Name', 'bmp');

The file will save as Name.bmp in the proper directory. However I did notice that when I try saving with the original code, the error also reads (I missed this bit sorry):

Can't open file "Image1\C:\Users\Shinobii\Documents\MATLAB\" for writing.

I think the pathname should read like

"C:\Users\Shinobii\Documents\MATLAB\Image1"

could this be the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:56:03+00:00Added an answer on June 8, 2026 at 11:56 am

    Small mistake:

    [FileName, PathName] = uiputfile('*.bmp', 'Save As'); %# <-- dot
    Name = fullfile(PathName,FileName);  %# <--- reverse the order of arguments
    imwrite(img, Name, 'bmp');
    

    Also its a good idea to check that the user didn’t cancel the dialog box:

    [FileName, PathName] = uiputfile('*.bmp', 'Save As');
    if PathName==0, return; end    %# or display an error message
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to capture a single image from my webcam and save it to
I have an image in an UIImageView and want to save it to the
I want to save the loaded image from server in idle time.I use the
I have some troubles with saving a image from memorystream. Here is my code:
I want to save image from chart graphic. I'm using following line. chart.SaveImage(D:\\mypic.png, System.Web.UI.DataVisualization.Charting.ChartImageFormat.Png);
Have a photography site that I want to prevent image copying from. How can
I want to save the image that is pinched to different size from original
I am trying to save an image from string. so I want to know
I want to be able to save a bitmap image with text from a
In my signed applet I have an Image object, Now I want to save

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.