Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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 ...

quasi 6 anni fa | 0

Risposto
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...

quasi 6 anni fa | 1

| accettato

Risposto
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...

quasi 6 anni fa | 2

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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;...

quasi 6 anni fa | 0

Risposto
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 ...

quasi 6 anni fa | 0

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

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

quasi 6 anni fa | 2

Risposto
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...

quasi 6 anni fa | 0

Risposto
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 ...

quasi 6 anni fa | 0

Risposto
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 ...

quasi 6 anni fa | 0

| accettato

Risposto
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...

quasi 6 anni fa | 0

Risposto
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...

quasi 6 anni fa | 0

Risposto
How to extract numeric matrix from this file .out
doc readmatrix see the 'NumHeaderLines' option and the 'Delimiter' option.

quasi 6 anni fa | 0

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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...

quasi 6 anni fa | 2

Risposto
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)

quasi 6 anni fa | 0

Risposto
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...

quasi 6 anni fa | 0

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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 ...

quasi 6 anni fa | 0

Risposto
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...

quasi 6 anni fa | 2

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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);

quasi 6 anni fa | 0

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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

quasi 6 anni fa | 1

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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 ...

quasi 6 anni fa | 1

| accettato

Risposto
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...

quasi 6 anni fa | 0

| accettato

Risposto
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...

quasi 6 anni fa | 1

| accettato

Carica altro