Answered
Problem with for loop and polyfit
Replace numbered variables with arrays. outLoop = 2; filter = (x1>3); x2 = x1(filter); for r = 1 : numel(outLoop) r...

circa 2 mesi ago | 1

| accepted

Answered
How to publish current m file output ONLY to pdf via inline code? (AKA, not via the Export function)
The code below works for me. options = struct('format','pdf','outputDir',pwd,'showCode',false,... 'codeToEvaluate',[func2s...

circa 2 mesi ago | 0

Answered
How to write the code for Appdesigner for when a user inputs the data and then store in a variable, inorder to use that value for a later caluclation?
Short answer: yes. If you want to use it in another function you might want to store it in a property (app.SomePropertyYouNeedTo...

circa 2 mesi ago | 0

Answered
The variable 'counter' is perhaps intended as a reduction variable, but is actually an uninitialized temporary.
Your loop depends on the previous iterations. You should calculate the value of the counter variable inside the loop. Otherwise ...

circa 2 mesi ago | 0

| accepted

Answered
Problem in legend plot in case of empty variable [ ]
I am going to assume your numbered variables are just to make this example easy to understand. If not: you should consider index...

circa 2 mesi ago | 0

Answered
Removing repeated in order elements from array?
No need for a loop (even if you should have replaced length by numel): data=[ 1 1 1 2 2 3 3 3 1 1 1 2 2 4 4 4 5 5 6]; L=diff(d...

circa 2 mesi ago | 0

Answered
Is cell2mat supposed to support non-plaid cell partitioning? If not, why not?
This doesn't answer your actual question, but below is code that should work on all combinations of non-plaid partitions. Some o...

circa 2 mesi ago | 1

Answered
How can I extract 2d slices images for all the CT volumes in a folder?
Your file name is based on slice (which contains the number of slices, not the slice number), instead of n and k. If all scans h...

circa 2 mesi ago | 0

| accepted

Answered
How do you append a vector to another vector within a loop?
The efficient way is not to do that. Use indexing instead. If the vectors are not equal length you can put them in a cell array ...

circa 2 mesi ago | 0

| accepted

Answered
Error executing .fig file during GUI creation
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. I would strongly rec...

circa 2 mesi ago | 0

| accepted

Answered
Will running MATLAB from an external hard drive work?
In my experience Matlab will run fine on removable media. If boot times are important to you, make sure you get a fast drive and...

2 mesi ago | 0

Answered
How do I and can I set up my MATLAB application to be used on my Apple IPAD as my second computer?
To the best of my knowledge, the Matlab apps for Android and iOS are only convenient portals to Matlab Online. So it wouldn't co...

2 mesi ago | 0

Answered
reads in n numbers from the user storing the numbers in a vector. Print the numbers from the ends inwards (last, first, second last, second, third)
You are asking the user for the number of elements. You should use that to pre-allocate the vector array so you can use indexing...

2 mesi ago | 0

| accepted

Answered
How do I rename variables from workspace for multiple matfiles?
With the syntax Les posted it is not possible to apply this to multiple mat files and variables automatically, which is one of t...

2 mesi ago | 2

Answered
waitbar cancel doesn't work
You forgot to set the value first and you reversed 0 and 1: f = waitbar(0,'Loading','Name','Exporting...',... 'CreateCance...

2 mesi ago | 0

| accepted

Answered
Extract info using regular expression matching
Maybe this is what you need? myinp = {['getval(' '''MYINFO\ECE1''' ')' '==19 & (getval(' '''MYDataCode\CSE''' ') >= 4) & (getva...

2 mesi ago | 0

| accepted

Answered
When debugging in R2021b, the current line is highlighted in light green making it impossible to read the line when the text color is light and background is dark.
The line highlight has been changed to a much darker shade of green in R2022a. This leaves code readible if you have set your fo...

2 mesi ago | 2

| accepted

Answered
Simple mex file crash?
Despite what you indicate in the 4th line, inData and outData are not actually double*, they are mxDouble*. As you can see in t...

2 mesi ago | 0

Answered
Enabling multiple Edit Fields
I suspect this is what you need. I don't know if this works in AppDesigner, but this is how it normally works in Matlab: a=2; ...

2 mesi ago | 1

| accepted

Answered
How do I create a Greek letter in live editor?
Matlab variable names are not allowed to contain rich text. They must start with a-z or A-Z, after which up to 62 characters are...

2 mesi ago | 0

| accepted

Answered
I'm a student and I want to access matlab fundamentals course.but my college don't have license and they are asking me to get a cracked version?I want to learn matlab
It sounds like you would be elligible for the student license, which is a lot cheaper than the home license (exact numbers depen...

2 mesi ago | 0

| accepted

Answered
How to get colormap of a non-indexed RGB image?
Since a colormap is a symbolic representation of the colors (and the number are not actually guaranteed to mean anything), you m...

2 mesi ago | 0

Answered
Writing a script for Goldbach's Conjecture
I think the goal is to use implicit expansion to create an array with the sums of all primes. A bit like this: A=[1 2 3 5];...

2 mesi ago | 0

| accepted

Answered
How can I save my scalogram image?
Since it clears the current figure (and then creates the object, the easiest way is to this: img=cwt(signal); exportgraphi...

2 mesi ago | 0

| accepted

Answered
Export plots as png
There is a reason export_fig has over 300000 download by now: it works more often than the normal built-in tools. You can get it...

2 mesi ago | 0

| accepted

Answered
store performance coefficient of different iterations in a vector
Following the standard strategy: nse1_vector=NaN(1,1000); nse1_vector(1)=0.1; nse1_index=1; % ANN Model-------------------...

2 mesi ago | 0

| accepted

Answered
Preallocating for speed?
When you append data to a variable like this: a=[1 2 3]; a=[a 4]; Matlab first allocates a block of memory large enough to ho...

2 mesi ago | 0

Answered
Matlab (GA or PSO) M-file for sizing & siting of distributed generation or distributed energy storage
The code requested in this question was originally posted in a blog at http://dg-algorithm.blogspot.com/2018/01/optimal-location...

2 mesi ago | 0

Answered
When using two separate edit fields in Matlab app designer, how to save both into a text file?
If you want to write both values, you need to specify that, or append instead of overwriting. %When user types into box, save i...

3 mesi ago | 0

Answered
Issue with figure display
The command you posted will set the default visibility property to off. That means that a new figure that is created will have i...

3 mesi ago | 0

| accepted

Load more