Community Profile

photo

per isakson


KTH

2,088 2010 年以降の合計貢献数

連絡する

per isakson's バッジ

  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 4
  • First Submission
  • Revival Level 3
  • Ace
  • 36 Month Streak
  • Thankful Level 3
  • Knowledgeable Level 4
  • First Answer
  • Leader
  • Speed Demon
  • Promoter
  • Commenter
  • Solver

詳細を表示...

貢献した分野
表示方法

回答済み
Error using - Matrix dimensions must agree.
I get a different error. One reason for the difference in the wording is that we run different releases of Matlab(?). I run R201...

1日 前 | 0

回答済み
How do I save each iteration of a loop into a matrix?
Replace for i=0:n c=circshift(p, [0, i]); end by c = nans(n,1); for i=0:n c(i)=circshift(p, [0, i]); end

2日 前 | 0

回答済み
Using Load in a test methods makes the test pass
Looks like a bug to me, however in programs one ought to use the functional form S = load('matlab.mat'); In that case the test...

2日 前 | 0

回答済み
Trouble reading the file with strread and textscan
"Illegal use of reserved keyword "end". " Deleting some code may leave a spurious end sometimes far to the right outside the ...

4日 前 | 0

回答済み
Loop for sequence of text files
See How can I process a sequence of files?

4日 前 | 0

回答済み
How to perform operations depending on a value in an array
This works accourding to your expectations - I think. %% C=[10,8,34,7,7,24,11,15,10,13,13,20,17,39,6,9,5,21]; data=2200; for...

5日 前 | 0

| 採用済み

回答済み
Change folder vs change directory
Matlab issues the message that you refer to in "Change folder is the option that sometimes matlab ask before running the script"...

5日 前 | 0

回答済み
How can I save data from features files into matrix?
I understand that "data for each feature for 500 images" is in ONE text file with 500 blocks of six rows. The format is illust...

5日 前 | 0

| 採用済み

質問


Regular expression. Are nesting of group operators supported?
Regarding Grouping Operators the function, regexp, doesn't behave the way I expected. >> cac = regexp( 'ABC', '((A)(B(C)))'...

6日 前 | 1 件の回答 | 2

1

回答

回答済み
Question about column operator vectors
Doc says x = j:k creates a unit-spaced vector x with elements [j,j+1,j+2,...,j+m] ... x = j:i:k creates a regularly-sp...

6日 前 | 0

| 採用済み

回答済み
how to run function 1000 times to find minimum
Something like S = struct( 'score', cell(1,1000), 'grouping', cell(1,1000) ); for jj = 1 :1000 S(jj).grouping = randomize...

6日 前 | 1

| 採用済み

回答済み
Rename and save multiple .mat files.
"the name on the work space is the old name" What do you expect? It's the names of the variables contained in the mat-file. The...

7日 前 | 0

回答済み
How to extract text from string at the same location, one line above
"Is there a better/more efficient way of achieving this?" No, I don't think so. However, speed depends on how "each line for ea...

7日 前 | 0

| 採用済み

回答済み
Replace odd numbers with infinity
%% C = randi([100,200],3,6) is_odd = rem(C,2) == 1; D = C; D( is_odd ) = inf returns C = 117 103 107 159 122 ...

7日 前 | 0

| 採用済み

回答済み
Using dir() without changing directory?
Use an absolute path rather than a relative path (as proposed in the comments). It's easier to get it right. Thus try sad = di...

8日 前 | 0

回答済み
how can I read file from a different directory
If you know the full directory name of 'b' use that, i.e chr = fileread( fullfile( 'c:', 'full', 'directory', 'name', 'of', 'b'...

9日 前 | 1

| 採用済み

回答済み
creating a matrix in matlab using a text file
It's the brackets, [], that confuses Matlab. Try A = readmatrix( 'output.txt', 'Whitespace',' []' ); I have R2018b so I can'...

9日 前 | 1

| 採用済み

回答済み
Nested for loop not iterating
I'm just guessing. Replace a_p = agrid(i) b_p=bgrid(j); fhat(i,j)=(a_p(i))-(b_p(j)).*magrange; by fhat(i,j) = ( agrid(i) - ...

10日 前 | 0

回答済み
Previously accessible file is now inaccessible
You need to close the file after reading, add fclose( fileID ) after filedata = textscan(fileID, '%s %s %s %s %s %s %s %s')...

約1ヶ月 前 | 0

| 採用済み

回答済み
How to convert all the rows containing char values to numbers in a table without for loop?
Replacing str2num by str2double might help. str2num uses eval(), which is slow. str2double takes arrays as input. %% cac =...

約1ヶ月 前 | 0

回答済み
How to extract a vector from a matrix and save in workspace?
"can I use them in a loop using their names" NO but you can loop over the columns of the matrix for jj = 1 : size( M, 1 ) ...

約1ヶ月 前 | 0

| 採用済み

回答済み
Why eval seems to be faster than other alternatives in this example?!
Testing is tricky >> Untitled5 Elapsed time is 0.167926 seconds. Elapsed time is 0.007457 seconds. Elapsed time is 0.010043...

約1ヶ月 前 | 0

| 採用済み

回答済み
how do I substitute all negative values in a vector with a random number between 0 and 2
One way >> Y = randi( [-4,4], 1,12 ); % sample vector >> isneg = Y < 0; >> Y( isneg ) = 2*rand( 1, sum(isneg) ) Y = Co...

約1ヶ月 前 | 0

回答済み
Alternative to using global for a very large array
"unjustified waste of memory" Matlab is smarter than that, see Avoid Unnecessary Copies of Data. If LUT is look-up-table a...

約1ヶ月 前 | 0

| 採用済み

回答済み
Integer check
function isf = isflint( m ) % floating double only % % http://www.mathworks.com/company/newsletters/news_notes/pd...

約1ヶ月 前 | 0

回答済み
Is vaderSentimentScores available in R2019a
No, vaderSentimentScores was Introduced in R2019b. See bottom of the page.

約1ヶ月 前 | 0

| 採用済み

回答済み
Regexp lookbehind and lineanchors
"My intent is to match 'c' that is preceded by the beginning of a line and zero or more white character." In the character arra...

約1ヶ月 前 | 0

| 採用済み

回答済み
How to use a percentage number time with a matrix
matrix * (100-10)/100

約1ヶ月 前 | 0

| 採用済み

回答済み
Matrix Dimensions Must Agree
Is this a copy&paste error? W=imread('copyright1.png'); I=imresize(I,[300 300]); Replacing the line by W=imread('copyright1....

約1ヶ月 前 | 0

回答済み
Opening R2018b .m files in R2019b
Most likely the reason is that your search path of the R2018b installation is not carried over to the R2019b installation. See S...

約1ヶ月 前 | 0

Load more