Réponse apportée
looping based on filename-length
You can use strsplit to split the file name in the chunks, as they seem to be delimited by points. Then you can select the appro...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
matlab standalone does NOT exit when run in Windows cmd
That documentation seems strange to me from a Windows standpoint. Unless you spawn a process by using the batch command start a ...

plus de 5 ans il y a | 0

Réponse apportée
Modify a text file
You can get my readfile function from the FEX or through the AddOn-manager (R2017a or later). data=readfile(filename); HeaderL...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Filling a matrix using vectorization
The problem is that this: A([1 2],[1 3]) returns 4 positions, not two. If you want two instead, you will need to convert subin...

presque 6 ans il y a | 2

| A accepté

Réponse apportée
State button callback- break while loop?
In general the solution to this is to use a flag that is controlled by your button. Then inside the while loop you check for tha...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Store values generate in a function call in an array
Instead of using a cell array, you can also use a 3D matrix: [~,~,~,spheresXYZ]=createspheres(0,0,0);spheresXYZ(1,1,SizeXYZ)=0;...

presque 6 ans il y a | 0

Réponse apportée
Look for minimum value in array
Loops aren't slow. You generally only need to remove them if there are native functions that accept array inputs, which happens ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to create randomly distributed triangles
Slightly editing your code gets me to a max framerate of just under 200. Results will vary for different systems. w = 3 ; ar=0...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
请问学生版的matlab可以在两台不同的电脑上安装吗?
Yes, but you have two buy two licenses. Technically it is possible to deactivate the license on one computer and activate it on...

presque 6 ans il y a | 2

Réponse apportée
i am trying to find an x value when my y value is equal to 0
The chance that you end up with a value that is exactly 0 is quite small. You can use code like below as an alternative. [~,idx...

presque 6 ans il y a | 0

Réponse apportée
system function cmdout has ' to the end
That is not an additional apostrophe. Your char array has a newline character at the end. So that apostrophe is not part of the ...

presque 6 ans il y a | 0

Réponse apportée
Create a 2d matrix with two nested cycle
Dynamically growing arrays is a bad idea. You should probably provide more details about your actual goal, because this problem ...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
array exceeds maximum array size preference (when summing)
Use squeeze around the two terms you want to sum. The dimensions are different, so your current code attempts to use dynamic exp...

presque 6 ans il y a | 0

Réponse apportée
Can MATLAB only be downloaded on one computer?
That depends on your license. I have understood that some home licenses will allow you to have Matlab activated on up to three c...

presque 6 ans il y a | 0

Réponse apportée
How to extract numeric matrix from this file .out
doc readmatrix see the 'NumHeaderLines' option and the 'Delimiter' option.

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Using FORTRAN code in MATLAB
You can compile Fortran code to mex, after which you can use it in Matlab as a function. Read the documentation for the API deta...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
For Cody challenges, should the best solutions be based on the least number of characters used in one's code?
My personal opinion: no. I would favor a different metric: time. If you go for character count, that will only drive the use of...

presque 6 ans il y a | 2

Réponse apportée
How to calculate intensity mean of certaian coordinates of an 3d CT dicom image when radius is given
SE=ones(10,10,2); SE=SE/sum(SE(:)); averaged=convn(IM,SE,'same'); averaged(x,y,z)

presque 6 ans il y a | 0

Réponse apportée
A guide to flag or close questions
Only flag a comment/question when: it requires attention from staff members it should be deleted/closed, but you don't have su...

presque 6 ans il y a | 0

Réponse apportée
For loop with random value to select from an array
If you only want a single value from your array I would suggest this code: clearvars; clc y=[1 5 4 3 2]; for i=1:8 ne...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
help with matrix addition and for loops
There are several issues with your code (not in any particular order): Your error message can't be reached, because that if is ...

presque 6 ans il y a | 0

Réponse apportée
Finding the number of rows to the next row containing a 1
It took some time, but here is a solution that should also work for large matrices. clc,clear format compact A = [0 0 0 1 0 1...

presque 6 ans il y a | 2

| A accepté

Réponse apportée
Function output wrong size
I don't understand why you would store the result val_2 in multiple positions, instead of only in i,j. Another thing I don't un...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to use isfinite() to mark if entry of cell array is {0×0 double}
Why don't you want to use the isempty option in cellfun instead? out=1-cellfun('isempty',gaitpar);

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Tricky randomization issue - help needed!
Because we now have a proper definition of the problem we can start writing the code for the solution: rng(1)%set a random seed...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
trying to have two figures on the same screen?
figure(9) subplot(2,2,[1 3]) %your fig 7 code subplot(2,2,2) %fig8 sub1 subplot(2,2,4) %fig8 sub2

presque 6 ans il y a | 1

| A accepté

Réponse apportée
Why while end error does not work in my code??
Based on your now deleted comment ("Yeah, when i put semicolons it worked."): The cause of the loop seeming to be stuck is that...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
How to read the text file start from 7th line and convert the date into datenum?
Assuming each line is a cell: %01-Jan-1993 00:00:00 % 11111111112 %12345678901234567890 % date ...

presque 6 ans il y a | 1

| A accepté

Réponse apportée
How to split text files into many text files?
The code below assumes each file ends with an empty line. You could also search for 'Lat:' instead to determine the beginning of...

presque 6 ans il y a | 0

| A accepté

Réponse apportée
Error when using 'Run Section'
Remove the randi function here from your path: C:\Users\maris\Desktop\Bachelor Thesis\mvgc_v1.0\mvgc_v1.0\utils\legacy\randi\ra...

presque 6 ans il y a | 1

| A accepté

Charger plus