답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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 ...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 1

| 수락됨

답변 있음
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...

5년 초과 전 | 2

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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;...

5년 초과 전 | 0

답변 있음
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 ...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

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

5년 초과 전 | 2

답변 있음
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...

5년 초과 전 | 0

답변 있음
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 ...

5년 초과 전 | 0

답변 있음
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 ...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 0

답변 있음
How to extract numeric matrix from this file .out
doc readmatrix see the 'NumHeaderLines' option and the 'Delimiter' option.

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 2

답변 있음
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)

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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 ...

5년 초과 전 | 0

답변 있음
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...

5년 초과 전 | 2

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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);

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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

5년 초과 전 | 1

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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 ...

5년 초과 전 | 1

| 수락됨

답변 있음
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...

5년 초과 전 | 0

| 수락됨

답변 있음
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...

5년 초과 전 | 1

| 수락됨

더 보기