Unable to write file [closed] - matlab

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to write an image in MATLAB, but got the following error:
Error using imwrite (line 455) Unable to open file "D1.bmp" for
writing. You may not have write permission.
Why is that? How can I go around this error?

As the error suggests, it would seem that you do not have permission to write the file where you are trying to save it. Make sure that you are not trying to write to a protected area of the computer.

If changing the filename but not the location fixed this problem, it's possible that you had an existing file, "D1.bmp", which was inaccessible for Matlab to write to, possibly because it was open in another program.
In some cases (dependant on Matlab version, I think - can't reproduce on this computer) this can happen just from having the directory open in Windows Explorer. See, for example, here (Mathworks Support link).
If you want to avoid accidentally overwriting images, you can use exist to check if a filename is already in use, and if so change the filename (i.e. go to D2.bmp or D1_01.bmp), rather than changing the image format.

The problem was solved when I changed the extension of the written image to jpg instead of BMP.

Related

Can't use array as an reference SnortSnarf HTMLMemStorage [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I'm trying to install SnortSnarf and I'm getting the following error on Ubuntu, next to the terminal is the HTMLMemStorage.pm file.
I've tried playing around with Line 290 but none of it worked and there doesn't seem to be any solutions I could find online about this. I've tried https://www.linuxquestions.org/questions/linux-security-4/snortsnard-generation-problem-111708/ and CGI error Can't use an array as a reference but it's not deprecated so I'm not sure how to go from here.
The left-hand side of -> must be an expression that returns a reference.
I think you want
$arr->[...]

How do I download MatLab packages? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
It seems this has not been asked before - and maybe I'm too dumb to figure it out myself. I am trying to download a specific MatLab package and being decently new to MatLab - I have no idea how to get it to work. There is no exe file or anything that denotes usefulness in "downloading" it into my MatLab software. The package in question can be found [here]. It is called MetSign - open-source made by UL and I would like to check it out. Thank you for any help.
On the link you provide, at the bottom there's a link saying "download". Click that, and it will take you to SourceForge, a download website for open source software. Wait for a few seconds, and download of a .zip file will start. Wait for the download to complete, and save the .zip file somewhere on your computer. Unzip the file to somewhere on your computer. Inside you'll find a bunch of .m files. These are MATLAB code files. Within MATLAB, add the folder containing the downloaded code to your MATLAB path using the command addpath. Now run the code. I can't help you much with that step, as I have no idea what the code does, but on the original download page there are also links to some academic papers describing the code - I imagine these will give you some hints about how to run it.

Matlab on Ubuntu: Unable to read file [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I am trying to run a MATLAB program on my computer running Ubuntu 12.04. Then when it runs to the code
load('data\sparse_combinations\Tw.mat', 'Tw')
MATLAB will report this error
Error using load
Unable to read file 'data\sparse_combinations\Tw.mat': no sucn file or directory
But when I enter the directory 'sparse_combinations', then run the code
load('Tw.mat')
it works well.
Can you help me find the reason?
As pointed out by #Marcin the problem is the usage of the wrong path seperator.
A good and general fix for this type of issue would be the use of fullfile - this command takes care of the issues of path seperation and platforms for you.
load( fullfile('data','sparse_combinations','Tw.mat'), 'Tw')
will work both on windows machines as well as Linux/Unix ones. No need to change code when porting to other platforms!

How can I get the highlighted text from PSPDFKit? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I am using PSPDFKit to let users highlight text in a document. Is there anyway to get the actual text that was highlighted? So in the following example, I would like to get the text "the good and bad" when the user highlights it.
Looking at the PSAnnotations, I've tried the value and contents properties but neither gives me what I want.
I'm the CEO of PSPDFKit GmbH.
All you need to do is get the PSPDFHighlightAnnotation (e.g. via annotationsForPage:type: in PSPDFDocument and then call highlightedString on it.
Please be aware that this is only an approximation. We only know the position of each individual glyph on the page, and from that, PSPDFKit tries to reconstruct words, lines and text boxes. So highlightedString might not always return 100% what you'd expect, especially if the PDF is not well-designed. But in general, it's quite good.

Eclipse - show only tabs from working set [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Is there a way to show/filter the open tabs by the currently selected working set ?
I mean, when I select a working set the editor view only show the related files.
I've searched around in google, stackoverflow and eclipse market, but found nothing.
No you can't. I believe the reason is that if you try to open another file that is not in the working set (e.g. You want to open the declaration of a class in the source code), then you get into a contradiction. You've said that you only want tabs from the working set, but you're also asking for a tab that's not in the working set.
I suppose it's possible to write a plugin that on request will close any editor that's open on a file not in the working set, but that's about the best you could do.
You can try to use Mylyn task focused interface.
It does not exactly what you are looking for, but it is the closest tool that I can think of.