Réponse apportée
convert current date and time to char
datestr(now-6/24,31) datestr(now_UTC-6/24,31) If you want to force the use of UTC+0 as the timezone (as your Z seems to sugges...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
How to Store emojis when used as an input to text field in App Designer.
Encoding is very important here. CSV files are simply plain text files. That means you need to make sure the encoding allows uni...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Computing Euclidean distance between 2 points
By doing a matrix multiplication on a vector, you implicitly take the sum over all elements. Note that this will only work if b...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
Multiplying each cell in an array by a column vector
You should use a loop. That makes it a lot easier to write the indexing you need, and it will be faster. Matrix operations are ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
how to count the number of lines of an external txt file
The problem with your question is that it lacks a definition of line. If your file ends with char(10) or char(13) does that sign...

presque 4 ans il y a | 0

Réponse apportée
Matlab GUI - storing real time data
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread. Using GUIDE is a bad ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Create a GUI interface in MATLAB for simple image functions like reading and displaying??
For general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.

presque 4 ans il y a | 0

Réponse apportée
Creating an active graph that allows variables to be updated in real time.
Plot once, and use the callback function of a slider to set the XData and YData properties of that object. Don't forget to ro...

presque 4 ans il y a | 1

Réponse apportée
Shading with vertical lines
I have put some inefficient code at the start to integrate over y so you end up with a function of x alone. I then used the same...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Using function in a serial code
If you insert the body of this function in a different function, you essentially convert this into a script. The downside of a ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
How do I have my variable output be uniform?
Arrays in Matlab must be rectangular. The image you show does not show how the data is stored, it is merely a display. For longe...

presque 4 ans il y a | 0

A soumis


isnetavl
Check for an internet connection by pinging one of Google's DNSes

presque 4 ans il y a | 1 téléchargement |

5.0 / 5
Thumbnail

Réponse apportée
Continuously pressing GUI slider arrow causes hanging
I would suggest setting a flag (and storing it in the guidata struct). That way you can immediately exit the function if it is a...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Reset Button in appdesigner
You should be able to adapt my answer <https://www.mathworks.com/matlabcentral/answers/502084-pass-input-data-obtained-from-gui-...

presque 4 ans il y a | 0

Réponse apportée
How to make a function file that displays a polynomial and accepts a specific command?
Why do you want to call your function like that? lou(a, b, c) will already work. Anyway: function lou(a,b,c) if nargin=...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Why does following code don't give any output?
Because the number 3 doesn't exist in your array: data=0.1:0.1:12; [~,ind]=min(abs(data-3)); data(ind) Now, that looks like ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Installing a loop for more efficient script
If there is no way to determine these values, you will have to hard-code them somewhere. So you might as well do it in a cell ar...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Extract data for 3d plated grave
Let's first run your code: figure(1) r=3; th=0:180/30:360; Lgt=length(th); for height=0:4:20; x=r*cos(th); y=r*si...

presque 4 ans il y a | 1

Réponse apportée
what are the following C datatypes Equivalents in Matlab
Integer names in Matlab are much more clear than in C: uint8 uint16 uint32 uint64 int8 int16 int32 int64. The ones starting with...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Trying to convert whole folder into spectrograms
You are inserting all files at once, instead of indexing into the filelist array. If you want want to store an image you need...

presque 4 ans il y a | 0

Réponse apportée
find the minmum value in each column of a matrix
If you set all values of 0 to NaN, you can do this simply with the min function. A=[ 0 10.1164 0 0 ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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 ...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 0

Réponse apportée
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...

presque 4 ans il y a | 1

Réponse apportée
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...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
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 ...

presque 4 ans il y a | 0

| A accepté

Charger plus